This commit is contained in:
Artem Horbunov 2020-03-05 21:17:34 +01:00
parent ae8fc0610d
commit 3aa99bdd09

View File

@ -1,12 +1,14 @@
#include <stdio.h> #include <stdio.h>
#include <string.h>
int main(){ int main(){
int c = 0; int c = 0;
char text[256];
while(1){ while(1){
char ch; char ch;
int num = 'a' - 'A'; int num = 'a' - 'A';
scanf("%c", &ch); scanf("%c", &ch);
if(ch == 'q' || ch == -1){ if(ch == EOF || ch == -1){
break; break;
} }
c++; c++;
@ -18,8 +20,19 @@ int main(){
ch -= num; ch -= num;
c--; c--;
} }
printf("%c", ch); text[c] = ch;
} }
printf("Počet riadkov: %d\n", c); 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("%d\n", c);
}