Update cv1/program.c

This commit is contained in:
Yurii Yakovenko 2024-09-30 20:20:35 +00:00
parent e588fa5727
commit aab3da0a10

View File

@ -7,8 +7,7 @@ bool check(char* s2, char *pz)
char *s=(char*) malloc(strlen(s2)+1); char *s=(char*) malloc(strlen(s2)+1);
char shifer[85]="oizeasbtbq"; char shifer[85]="oizeasbtbq";
for(int i = 0; s2[i]!='\0'; i++) for(int i = 0; s2[i]!='\0'; i++)
{ {
//printf("%d ",i); //printf("%d ",i);
s[i]=tolower(s2[i]); s[i]=tolower(s2[i]);
@ -32,19 +31,19 @@ int main()
char *p; char *p;
float price; float price;
int count =0; int count =0;
printf("Zadaj hladanu surovinu:\n");
scanf("%s", pizz); scanf("%s", pizz);
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;
//else printf("\n============ %s",r);
if(scanf("%f", &price)!=1) if(scanf("%f", &price)!=1)
break; break;
//else printf("%f",price);
if(check(r, pizz)) if(check(r, pizz))
{ {
count++; count++;
@ -55,4 +54,3 @@ int main()
return 0; return 0;
} }