pvjc22/du1/program.c

34 lines
499 B
C
Raw Normal View History

2022-02-20 12:20:20 +00:00
#include <stdio.h>
int main(){
2022-03-01 17:30:30 +00:00
int c = 0;
2022-03-01 17:51:15 +00:00
int a = 0;
2022-03-01 18:01:36 +00:00
int counter = 0;
2022-03-01 17:51:15 +00:00
char small[] = "abcdefghijklmnopqrstuvwxyz";
char big[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
2022-03-01 17:30:30 +00:00
char d;
2022-03-01 18:01:36 +00:00
while(c = 1){
2022-02-20 12:20:20 +00:00
c = getchar();
2022-03-01 17:51:15 +00:00
d = c;
int a = 0;
2022-03-01 18:01:36 +00:00
if(d == '\n'){
counter++;
break;
}
2022-03-01 17:51:15 +00:00
while(a > 26){
if(d == small[a]){
2022-03-01 18:01:36 +00:00
d = big[a];
2022-03-01 17:51:15 +00:00
break;
}else if(d == big[a]){
2022-03-01 18:01:36 +00:00
d = small[a];
2022-03-01 17:51:15 +00:00
break;
2022-03-01 18:01:36 +00:00
}
a++;
2022-02-20 12:26:50 +00:00
}
2022-03-01 18:01:36 +00:00
c = d;
2022-03-01 17:51:15 +00:00
putchar (c);
2022-02-20 12:20:20 +00:00
}
2022-03-01 18:01:36 +00:00
printf("\nPočet riadkov: %d\n",counter);
2022-02-20 12:20:20 +00:00
return 0;
}