This commit is contained in:
Artem Horbunov 2020-03-06 11:16:53 +01:00
parent 3aa99bdd09
commit 0374179528

View File

@ -1,38 +1,41 @@
#include <stdio.h> #include<stdio.h>
#include <string.h>
char change(char inp){
if(inp >= 'A' && inp <= 'Z'){
inp += 'a' - 'A';
return inp;
}
else if(inp >= 'a' && inp <= 'z'){
inp -= 'a' - 'A';
return inp;
}
}
int main(){ int main(){
int c = 0; char text[255];
char text[256]; int num = 0;
while(1){
char ch; for(int i = 0; text[i] != EOF; i++){
int num = 'a' - 'A'; scanf("%c", &text[i]);
scanf("%c", &ch); }
if(ch == EOF || ch == -1){
break; int len = sizeof(text);
} for(int i = 0; i < len; i++){
c++; if(text[i] == '\n') num += 1;
if(ch <= 'A' && ch >= 'Z'){ }
ch += num;
c--; for(int i = 0; text[i] != '\n'; i++){
} printf("%c\n", change(text[i]));
else if(ch >= 'a' && ch <= 'z'){ }
ch -= num;
c--; for(int i = -1; i < num; i++){
} printf("\n");
text[c] = ch; }
}
printf("%d\n", strlen(text)); printf("Počet riadkov: %d\n", num);
for(int i = 0; i < c; i++){
if(text[i] != '\n'){ return 0;
printf("%c\n", text[i]);
}
else{
printf("\n");
}
}
printf("%d\n", c);
} }