pvjc20/du1/program.c

26 lines
445 B
C
Raw Normal View History

2020-03-05 17:42:03 +00:00
#include <stdio.h>
int main(){
2020-03-05 19:56:29 +00:00
int c = 0;
while(1){
char ch;
int num = 'a' - 'A';
scanf("%c", &ch);
if(ch == 'q' || ch == -1){
break;
}
c++;
if(ch <= 'A' && ch >= 'Z'){
ch += num;
c--;
}
else if(ch >= 'a' && ch <= 'z'){
ch -= num;
c--;
}
printf("%c", ch);
2020-03-05 19:04:02 +00:00
}
2020-03-05 19:56:29 +00:00
printf("%d\n", c);
2020-03-05 17:42:03 +00:00
}
2020-03-05 19:56:29 +00:00