This commit is contained in:
Artem Horbunov 2020-03-05 20:56:29 +01:00
parent 5dca2572bf
commit 87a6b669ef

View File

@ -1,19 +1,25 @@
#include <stdio.h> #include <stdio.h>
int main(){ int main(){
int c = 0;
char ch; while(1){
int num = 'a' - 'A'; char ch;
scanf("%c", &ch); int num = 'a' - 'A';
if(ch == EOF || ch == -1){ scanf("%c", &ch);
return 0; 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);
} }
if(ch >= 'A' && ch <= 'Z'){ printf("%d\n", c);
ch += num;
}
else if(ch >= 'a' && ch <= 'z'){
ch -= num;
}
printf("%c", ch);
} }