Update cv1/program.c

This commit is contained in:
Yurii Yakovenko 2024-10-01 19:07:16 +00:00
parent c77dcf6c27
commit 570d9ec039

View File

@ -5,6 +5,10 @@
bool check(char* s2, char *pz)
{
char *s=(char*) malloc(strlen(s2)+1);
if(s==NULL)
{
return false;
}
char shifer[85]="oizeasbtbq";
for(int i = 0; s2[i]!='\0'; i++)
@ -38,19 +42,28 @@ int main()
{
printf("Zadaj␣jedalny␣listok:\n");
do
p=fgets(r, 299, stdin);
while(p!=NULL && p[0]=='\n');
if(p==NULL)
break;
if(scanf("%f", &price)!=1)
break;
if(check(r, pizz))
{
count++;
printf("%s %.2f\n", r, price);
}
p=fgets(r, 299, stdin);
}
while(p!=NULL && p[0]=='\n');
{
if(p==NULL)
{
break;
}
if(scanf("%f", &price)!=1)
{
break;
}
if(check(r, pizz))
{
count++;
printf("%s %.2f\n", r, price);
}
}
}
printf("Nacitanyh %d poloziek", count);
return 0;
}
}