Aktualizovat „du6/program.c“

This commit is contained in:
Bohdan Yanchyk 2020-04-16 08:28:29 +00:00
parent 5c95d6b3b8
commit faa46b9f48

View File

@ -36,18 +36,9 @@ int main()
//int q = 0;
size_t pocet_znakov = 0;
int antiInfC = 0;
//char r;
char r = 'a';
while (fgets(line,wSIZE,stdin)) {
// if (r == '\n') {
// break;
// }
// if(antiInfC == SIZE - 1){
// break;
// } else{
// antiInfC++;
// }
k = 0;
pocet_znakov = strlen(line);
char* all = malloc(pocet_znakov);
@ -62,9 +53,10 @@ int main()
pole_smernikov[pm] = all;
pm++;
}
if((line[0] == '\n' || isalpha(line[0])!=0 ) && antiInfC == 1) {
if((line[0] == '\n' || isalpha(line[0])!=0 ) && antiInfC == 1 && r == '\n') {
break;
}
r = line[0];
antiInfC++;
}
free(line);