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'){
putchar (c[0] - 'a' + 'A');
printf ("\n"); printf ("\n");
counter++; counter++;
} }
else if ( c >= 'A' && c <= 'Z'){ else if ( c[0] >= 'A' && c[0] <= 'Z'){
putchar (c + 'a' - 'A'); putchar (c[0] + 'a' - 'A');
printf ("\n"); printf ("\n");
counter++; counter++;
} }
else if (!isalpha (c)) { else if (!isalpha (c[0])) {
putchar (c); putchar (c[0]);
counter++; counter++;
} }
c = getchar(); fgets(c, 100, stdin);
musor = getchar(); musor = getchar();
}
else{
for(int i = 0; i < 100; i++){
if(c[i] == '\n') break;
if(isupper(c[i]))
printf(tolower(c[i]));
else if(islower(c[i]))
printf(toupper(c[i]));
else
printf(c[i]);
}
}
//counter++; //counter++;
} }