Update cv1/program.c

This commit is contained in:
Yurii Yakovenko 2024-10-02 19:29:16 +00:00
parent f969aa795b
commit 4224709fbe

View File

@ -5,7 +5,7 @@
//
bool check(char* s2, char *pz)
{
char s[300];
char s[300], p[300];
if(s2==NULL || pz==NULL)
{
return false;
@ -15,6 +15,7 @@ bool check(char* s2, char *pz)
// {
// return false;
// }
// 0123456789
char shifer[15]="oizeasbtbq";
for(int i = 0; s2[i]!='\0'; i++)
@ -28,7 +29,20 @@ bool check(char* s2, char *pz)
}
}
s[strlen(s2)]=0;
bool rez=strstr(s, pz)!=NULL;
for(int i = 0; pz[i]!='\0'; i++)
{
//printf("%d ",i);
p[i] = tolower(pz[i]);
if(p[i] >='0' && p[i]<='9')
{
p[i]=shifer[p[i]-'0'];
}
}
p[strlen(pz)]=0;
//printf("========= %s %s %s", s2,pz,)
bool rez=strstr(s, p)!=NULL;
//free(s);
return rez;
@ -62,8 +76,7 @@ int main()
break;
}
if(check(r, pizz))
{
{
printf("%s%.2f\n", r, price);
}
count++;