pvjc22/du1/program.c
Yaroslav Orlianskyi 9f3f30fe2c SAD
2022-03-01 19:01:36 +01:00

34 lines
499 B
C

#include <stdio.h>
int main(){
int c = 0;
int a = 0;
int counter = 0;
char small[] = "abcdefghijklmnopqrstuvwxyz";
char big[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
char d;
while(c = 1){
c = getchar();
d = c;
int a = 0;
if(d == '\n'){
counter++;
break;
}
while(a > 26){
if(d == small[a]){
d = big[a];
break;
}else if(d == big[a]){
d = small[a];
break;
}
a++;
}
c = d;
putchar (c);
}
printf("\nPočet riadkov: %d\n",counter);
return 0;
}