funguje
This commit is contained in:
parent
ae8fc0610d
commit
3aa99bdd09
@ -1,12 +1,14 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int main(){
|
||||
int c = 0;
|
||||
char text[256];
|
||||
while(1){
|
||||
char ch;
|
||||
int num = 'a' - 'A';
|
||||
scanf("%c", &ch);
|
||||
if(ch == 'q' || ch == -1){
|
||||
if(ch == EOF || ch == -1){
|
||||
break;
|
||||
}
|
||||
c++;
|
||||
@ -18,8 +20,19 @@ int main(){
|
||||
ch -= num;
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user