Compare commits

..

2 Commits

Author SHA1 Message Date
dcf8e054b1 program 2023-02-23 14:06:37 +01:00
6a2397b937 program 2023-02-23 14:01:38 +01:00
2 changed files with 31 additions and 0 deletions

BIN
du1/program Executable file

Binary file not shown.

31
du1/program.c Normal file
View File

@ -0,0 +1,31 @@
#include <stdio.h>
int main(){
int c= 0;
int n=0; // pocet nacitanych znakov
while(1){
c = getchar();
if(c!=-1){ //-1 eof koniec vstupu
if( c >= 'a' && c <= 'z'){ //porovnavam cisla v ascii tabulke
c=c+'A'-'a'; //velke pismeno na male
}
else if(c >= 'A' && c <= 'Z'){
c=c-'A'+'a'; //male pismeno na velke
}
}
else{
break;
}
n++;
putchar(c);
}
printf("\n");
printf("Pocet riadkov: %d\n", n); //vypise pocet zpouzitych znakov
return 0;
}