Update cv1/program.c

This commit is contained in:
Yurii Yakovenko 2024-10-01 19:27:56 +00:00
parent bacc2869ef
commit 6bc162f509

View File

@ -42,31 +42,30 @@ int main()
int count =0; int count =0;
printf("Zadaj hladanu surovinu:\n"); printf("Zadaj hladanu surovinu:\n");
scanf("%s", pizz); scanf("%s", pizz);
printf("Zadaj␣jedalny␣listok:\n");
while(1) while(1)
{ {
printf("Zadaj␣jedalny␣listok:\n");
do do
{ {
p=fgets(r, 299, stdin); p=fgets(r, 299, stdin);
} }while(p!=NULL && p[0]=='\n');
while(p!=NULL && p[0]=='\n'); if(p==NULL)
{ {
if(p==NULL) break;
{
break;
}
if(scanf("%f", &price)!=1)
{
break;
}
if(check(r, pizz))
{
count++;
printf("%s %.2f\n", r, price);
}
} }
if(scanf("%f", &price)!=1)
{
break;
}
if(check(r, pizz))
{
count++;
printf("%s %.2f\n", r, price);
}
} }
printf("Nacitanyh %d poloziek", count); printf("Nacitanyh %d poloziek", count);