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

@ -2,6 +2,8 @@
int main(){ int main(){
char word; char word;
char word;
for (int count = 0; (word = getchar()) != EOF;) { for (int count = 0; (word = getchar()) != EOF;) {
if (word >= 'a'&&word <= 'z') { if (word >= 'a'&&word <= 'z') {
word -= 32; word -= 32;
@ -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;
} }