43 lines
559 B
C
43 lines
559 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <ctype.h>
|
|
int main(){
|
|
int c = 0;
|
|
int count = 0;
|
|
int riadok = 0;
|
|
int pop = 0;
|
|
while(c != EOF){
|
|
c = getchar();
|
|
if(c == EOF){
|
|
break;
|
|
}
|
|
if((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')){
|
|
if(islower(c)){
|
|
c = toupper(c);
|
|
printf("%c\n", c);
|
|
riadok++;
|
|
count++;
|
|
}
|
|
if(isupper(c) && count == 0){
|
|
c = tolower(c);
|
|
printf("%c\n", c);
|
|
riadok++;
|
|
}
|
|
pop++;
|
|
}
|
|
if(c == 10){
|
|
printf("\n");
|
|
riadok++;
|
|
}
|
|
else{
|
|
if(pop == 0){
|
|
printf("%c\n", c);
|
|
riadok++;
|
|
}}
|
|
count = 0;
|
|
pop = 0;
|
|
}
|
|
printf("\nPočet riadkov: %d\n", riadok);
|
|
return 0;
|
|
}
|