Aktualizovat „du1/program.c“

This commit is contained in:
Bohdan Yanchyk 2020-03-01 09:02:42 +00:00
parent 908c1cfdd0
commit 135d56b9db

View File

@ -1,5 +1,7 @@
#include <stdio.h> #include <stdio.h>
int main(){ int main(){
char word;
char word; char word;
for (int count = 0; (word = getchar()) != EOF;) { for (int count = 0; (word = getchar()) != EOF;) {
@ -11,13 +13,15 @@ char word;
} }
if (word == '\n') { if (word == '\n') {
count++; count++;
for(int i =0;i<count;i++){ for (int i = 0; i <= count; i++) {
printf("\n"); printf("\n");
} }
printf("Počet riadkov: %d", count); printf("Počet riadkov: %d\n", count);
} }
putchar(word); putchar(word);
} }
}
return 0; return 0;
} }