pvjc24/cv1/program.c

24 lines
402 B
C
Raw Normal View History

2024-02-17 16:49:04 +00:00
#include <stdio.h>
2024-02-15 07:23:00 +00:00
2024-02-17 16:49:04 +00:00
int main()
{
char c;
2024-02-22 12:36:59 +00:00
int counter=0;
2024-02-17 16:49:04 +00:00
while ((c = getchar()) != EOF) {
2024-02-22 12:47:39 +00:00
if (c >= 32 && c <= 126){
2024-02-17 16:49:04 +00:00
if(c<='z'&&c>='a'){
c=c+('A'-'a');
}else if(c<='Z'&&c>='A'){
c=c-('A'-'a');
}
2024-02-22 12:36:59 +00:00
if(c=='\n'){
counter++;
}
2024-02-17 16:49:04 +00:00
printf("%c",c);
2024-02-22 12:47:39 +00:00
}
2024-02-17 16:49:04 +00:00
}
2024-02-22 12:38:00 +00:00
printf("\nLines count: %d\n",counter);
2024-02-17 16:49:04 +00:00
return 0;
}