#include #include #include // bool check(char* s2, char *pz) { char *s=(char*) malloc(strlen(s2)+1); char shifer[85]="oizeasbtbq"; for(int i = 0; s2[i]!='\0'; i++) { //printf("%d ",i); s[i]=tolower(s2[i]); if(s[i] >='0' && s[i]<='9') { s[i]=shifer[s[i]-'0']; } } bool rez=strstr(s, pz)!=NULL; free(s2); return rez; } int main() { char r[300];//="8ryNd20va P1zza"; char pizz[99];//="piz"; char *p; float price; int count =0; scanf("%s", pizz); while(1) { do p=fgets(r, 299, stdin); while(p!=NULL && p[0]=='\n'); if(p==NULL) break; //else printf("\n============ %s",r); if(scanf("%f", &price)!=1) break; //else printf("%f",price); if(check(r, pizz)) { count++; printf("%s %.2f\n", r, price); } } printf("Nacitanyh %d poloziek", count); return 0; }