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;
} }
c++;
if(ch <= 'A' && ch >= 'Z'){ int len = sizeof(text);
ch += num; for(int i = 0; i < len; i++){
c--; if(text[i] == '\n') num += 1;
} }
else if(ch >= 'a' && ch <= 'z'){
ch -= num; for(int i = 0; text[i] != '\n'; i++){
c--; printf("%c\n", change(text[i]));
} }
text[c] = ch;
} for(int i = -1; i < num; i++){
printf("%d\n", strlen(text));
for(int i = 0; i < c; i++){
if(text[i] != '\n'){
printf("%c\n", text[i]);
}
else{
printf("\n"); printf("\n");
} }
} printf("Počet riadkov: %d\n", num);
printf("%d\n", c);
return 0;
} }