diff --git a/du6/program.c b/du6/program.c index f6860d5..ef734d3 100644 --- a/du6/program.c +++ b/du6/program.c @@ -5,7 +5,7 @@ int compare(const void* arg1, const void* arg2); -int main(){ +int main(a){ char* pole_smernikov[SIZE]; memset(pole_smernikov,0,SIZE*sizeof(char*)); @@ -15,6 +15,10 @@ int main(){ int p = 0; scanf("%d",&p); getchar(); + if(p<1){ + printf("Nespravny vstup\n"); + return 0; + } while(1){ char line[SIZE]; @@ -41,13 +45,13 @@ int main(){ int skip=0; - for(int j = 0;skip==0&& j='0'&&pole_smernikov[j][i]<='9'){ printf("Nespravny vstup\n"); skip=1; } - } + } } if (!skip){ @@ -59,6 +63,7 @@ int main(){ for(int i = p; i