1
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
#include <stdio.h>
|
||||
#include <wchar.h>
|
||||
#include <locale.h>
|
||||
|
||||
int alpha(wchar_t x);
|
||||
|
||||
int main() {
|
||||
setlocale(LC_ALL, "");
|
||||
int smol = 0,big = 0,symb = 0;
|
||||
wchar_t x;
|
||||
while((x = getwchar()) != WEOF){
|
||||
switch(alpha(x)){
|
||||
case 1: smol++;break;
|
||||
case 2: big++;break;
|
||||
default: symb++;break;
|
||||
}
|
||||
}
|
||||
printf("Пропись: %d\tСтрочных: %d\tОстальное: %d",smol,big,symb);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int alpha(wchar_t x){
|
||||
if (x >= L'A' && x <= L'Z')
|
||||
return 2;
|
||||
else if (x >= L'a' && x <= L'z')
|
||||
return 1;
|
||||
else if (x >= L'А' && x <= L'Я')
|
||||
return 2;
|
||||
else if (x >= L'а' && x <= L'я')
|
||||
return 1;
|
||||
else if (x == L'Ё')
|
||||
return 2;
|
||||
else if (x == L'ё')
|
||||
return 1;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
Reference in New Issue
Block a user