Nathan wants to implement wildcard pattern matching supporting only the wildcard '?'. The wildcard character '?' can be substituted by any single lower case English letter for matching. He has two strings X and Y of equal length, made up of lower case letters and the character '?'. He wants to know whether the strings X and Y can be matched or not.

#include <stdio.h>
#include<string.h>
#include<ctype.h>
int main()  
{int MAX=10;
 char a[MAX],b[MAX];
 int t;
 scanf("%d",&t);  while(t--){
 scanf("%s",a);  scanf("%s",b);
 int i,
 n=strlen(b),no=0;
 for(i=0;i<n;i++)
 {if(isalpha(a[i])&&isalpha(b[i])&&a[i]!=b[i])
 no++;}
 if(no>0)
 printf("No\n");
 else printf("Yes\n"); }
return 0;

Comments

Popular posts from this blog

Mukesh and Salima was looking to buy Organic Apples in the nearest fruits shop.But Shop Owner mixed the Hybrid apples in that Apple box. After sometimes Mukesh checking the box, he was confused among organic and hybrid apple. He started to count the hybrid apples. Please help to Mukesh Count the total number of hybrid apples in the box.

On one beautiful Sunday Selvan went to Aaron's house for exam preparation. They have decided to study Mathematics subject because they have exams by coming Monday, Aaron is a master in Mathematics but Selvan is not so good in Mathematics so James trained with Selvan for getting a high score in the exam. After teaching some problems to Selvan.Aaron have given some tasks to Selvan to solve .The problem is to convert input float into a double. Can you help Selvan in finding the solution ?

Binita was travelling from Chennai to Delhi in Rajdhani Express. The train have arrived at the destination later than the estimated time. So, Binita wants to know the total number of hours and minutes the train was delayed.Can you help Binita in finding the exact hour and time Rajdhani Express was delay on the day of Binita's journey?Print the Number of Hours and Minutes in a single line.