Aktualizovat „du1/program.c“

This commit is contained in:
Bohdan Yanchyk 2020-02-29 23:14:45 +00:00
parent 18101b3743
commit fe9d5084c0

View File

@ -1,5 +1,20 @@
#include <stdio.h>
int main(){
printf("Hello, world!");
char word;
for (int count = 0; (word = getchar()) != EOF;) {
if (word >= 'a'&&word <= 'z') {
word -= 32;
}
else if (word >= 'A'&&word <= 'Z'){
word += 32;
}
if (word == '\n') {
count++;
printf("\nPočet riadkov: %d\n", count);
}
putchar(word);
}
return 0;
}