Aktualizovat „du1/program.c“
This commit is contained in:
parent
18101b3743
commit
fe9d5084c0
@ -1,5 +1,20 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
int main(){
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user