fork download
  1. #include <stdio.h>
  2. #include <wctype.h>
  3. #include <wchar.h>
  4. #include <locale.h>
  5. #include <errno.h>
  6. #include <string.h>
  7. int main()
  8. {
  9. //system("chcp 1251");
  10.  
  11. setlocale(LC_ALL, "Russian");
  12. //SetConsoleCP(1251);
  13. ///SetConsoleCP(866);
  14. wchar_t c;
  15. //printf("муму\n");
  16. //int digit = 0, upper = 0, lower = 0;
  17. /*while ((c = fgetwc(stdin)) != WEOF) {
  18.   wprintf(L"%lc\n", c);
  19.   if (iswdigit(c)) {
  20.   digit++;
  21.   } else if (iswalpha(c) && iswlower(c)) {
  22.   lower++;
  23.   } else if (iswalpha(c) && iswupper(c)) {
  24.   upper++;
  25.   }
  26.   }*/
  27. c = fgetwc(stdin);
  28. printf("PRINF\n\n %d %s", (int)c, strerror(errno));
  29. //wint_t t = fputwc(c, stdout);
  30.  
  31. //wprintf(L"%d", t);
  32.  
  33. fflush(stdout);
  34. //printf("%d\n%d\n%d\n", digit, upper, lower);
  35. return 0;
  36. }
Success #stdin #stdout 0s 4384KB
stdin
к
stdout
PRINF

 -1 Invalid or incomplete multibyte or wide character