This commit is contained in:
Bohdan Kapliuk 2024-10-12 16:32:51 +03:00
parent ca9061ea52
commit fd95b3d553

View File

@ -16,10 +16,6 @@ int main(){
char vstup[STACK_SIZE]; char vstup[STACK_SIZE];
int counter = 0; int counter = 0;
while(1){ while(1){
if(counter > 10){
printf("full stack\n");
return 0;
}
if (fgets(vstup, sizeof(vstup), stdin) == NULL) { if (fgets(vstup, sizeof(vstup), stdin) == NULL) {
printf("no input\n"); printf("no input\n");
return 0; return 0;
@ -63,6 +59,10 @@ int main(){
} }
mystack.values[counter] = cislo; mystack.values[counter] = cislo;
counter++; counter++;
if(counter > 10){
printf("full stack\n");
return 0;
}
} }
mystack.size = counter; mystack.size = counter;
for(int i =0; i < counter;i++){ for(int i =0; i < counter;i++){