if this doesnt work, i am done
This commit is contained in:
parent
15d44f543e
commit
821b5dab26
57
a1/program.c
57
a1/program.c
@ -3,7 +3,6 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
//experimentalny refaktor kodu (bez obalovania tolower,toupper,iscntrl alebo isalpha do dalsich metod)
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
int pocetRiadkov = 0;
|
int pocetRiadkov = 0;
|
||||||
@ -33,7 +32,6 @@ int main()
|
|||||||
|
|
||||||
else if (iscntrl(vstup) != 0)
|
else if (iscntrl(vstup) != 0)
|
||||||
{
|
{
|
||||||
//preskoci iteraciu/cyklus, ak neviditelny znak, resp. nevypise ho
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,58 +39,3 @@ int main()
|
|||||||
printf("Lines_count: %d\n", pocetRiadkov);
|
printf("Lines_count: %d\n", pocetRiadkov);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// int GetTypZnaku(int vstup);
|
|
||||||
|
|
||||||
// int main()
|
|
||||||
// {
|
|
||||||
// int vstup = 0;
|
|
||||||
// int pocetRiadkov = 0;
|
|
||||||
// while (1)
|
|
||||||
// {
|
|
||||||
// //helper lok. premeny
|
|
||||||
// bool mozeBytPrinted = true;
|
|
||||||
// int vysChar = 0;
|
|
||||||
|
|
||||||
// //scanning faza programu
|
|
||||||
// vstup = getchar();
|
|
||||||
// vysChar = vstup;
|
|
||||||
|
|
||||||
// if (vstup == EOF) { break;} //ak EOF (End Of File), resp. koniec suboru
|
|
||||||
|
|
||||||
// if (vstup == '\n') // ak NewLine char, resp. koniec riadku
|
|
||||||
// {
|
|
||||||
// pocetRiadkov += 1;
|
|
||||||
// putchar(vstup);
|
|
||||||
// }
|
|
||||||
// //ak vstup == malemu pismenu
|
|
||||||
// else if (GetTypZnaku(vstup) == 0)
|
|
||||||
// {
|
|
||||||
// vysChar = toupper(vstup);
|
|
||||||
// }
|
|
||||||
// //ak vstup == velke pismeno
|
|
||||||
// else if (GetTypZnaku(vstup) == 1)
|
|
||||||
// {
|
|
||||||
// vysChar = tolower(vstup);
|
|
||||||
// }
|
|
||||||
// //ak to nie je neviditelny char (resp. riadiaci/control) a NIE je NewLine
|
|
||||||
// else if (GetTypZnaku(vstup) == 2 && vstup != '\n')
|
|
||||||
// {
|
|
||||||
// mozeBytPrinted = false;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// //output vidtelnehok charakteru
|
|
||||||
// if (mozeBytPrinted) { putchar(vysChar);}
|
|
||||||
// }
|
|
||||||
// printf("Lines_count: %d\n", pocetRiadkov);
|
|
||||||
// return 0;
|
|
||||||
// }
|
|
||||||
// int GetTypZnaku(int vstup)
|
|
||||||
// {
|
|
||||||
// if (islower(vstup) != 0) { return 0;}
|
|
||||||
// if (isupper(vstup) != 0) { return 1;}
|
|
||||||
// if (iscntrl(vstup) != 0) { return 2;}
|
|
||||||
// return -1;
|
|
||||||
// }
|
|
||||||
Loading…
Reference in New Issue
Block a user