druha verzia

This commit is contained in:
Oleksandr Hryshchenko 2021-02-23 17:15:49 +01:00
parent 4fdeeb1312
commit 2edebcc411

View File

@ -2,28 +2,41 @@
#include <ctype.h> #include <ctype.h>
int main (){ int main (){
int c = 0; char[100] c;
char musor; char musor;
int counter = 0; int counter = 0;
c = getchar(); fgets(c, 100, stdin);
musor = getchar(); musor = getchar();
while(fgets(input[c], 100, stdin) != EOF){ while(fgets(c, 100, stdin) != EOF){
if (c >= 'a' && c <= 'z'){ if(c[1] == '\n'){
putchar (c - 'a' + 'A'); if (c[0] >= 'a' && c[0] <= 'z'){
printf ("\n"); putchar (c[0] - 'a' + 'A');
counter++; printf ("\n");
counter++;
}
else if ( c[0] >= 'A' && c[0] <= 'Z'){
putchar (c[0] + 'a' - 'A');
printf ("\n");
counter++;
}
else if (!isalpha (c[0])) {
putchar (c[0]);
counter++;
}
fgets(c, 100, stdin);
musor = getchar();
} }
else if ( c >= 'A' && c <= 'Z'){ else{
putchar (c + 'a' - 'A'); for(int i = 0; i < 100; i++){
printf ("\n"); if(c[i] == '\n') break;
counter++; if(isupper(c[i]))
printf(tolower(c[i]));
else if(islower(c[i]))
printf(toupper(c[i]));
else
printf(c[i]);
}
} }
else if (!isalpha (c)) {
putchar (c);
counter++;
}
c = getchar();
musor = getchar();
//counter++; //counter++;
} }