Создал(а) 'du1.c'

This commit is contained in:
Vladyslav Korzun 2023-02-16 13:27:24 +00:00
parent 653cd1c174
commit 95b8c0d7f5

31
du1.c Normal file
View File

@ -0,0 +1,31 @@
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
int main(){
int count = 0;
int c = 0;
int riadok = 0;
printf("%c",c);
while(1){
c = getchar();
if(c == -1){
break;
}
count = 0;
if (c >= 'a' && c <= 'z'){
c = c - 32;
printf("%c \n", c);
count = 1;
riadok++;
}
if (c >= 'A' && c <= 'Z' && count == 0){
c = c + 32;
printf("%c \n", c);
riadok++;
}
c = getchar();
count = 0;
}
printf("Počet riadkov: %d", riadok);
return 0;
}