This commit is contained in:
Artem Horbunov 2020-03-05 20:04:02 +01:00
parent 77b6705fc1
commit 5dca2572bf

View File

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