Similar Dishes Solution

View previous topic View next topic Go down

Similar Dishes Solution

Post by iamdsc_0410 on Tue Apr 18, 2017 6:28 pm

#include<stdio.h>
#include<string.h>
int main()
{
int t,i,j,c;
scanf("%d",&t);
while(t>0)
{
c=0;
char f[4][11],s[4][11];
for(i=0;i<4;i++)
scanf("%s",f[i]);
for(i=0;i<4;i++)
scanf("%s",s[i]);
for(i=0;i<4;i++)
{
for(j=0;j<4;j++)
{
if(!strcmp(f[i],s[j]))
c++;
}
}
if(c>=2)
printf("similar\n");
else
printf("dissimilar\n");
t--;
}
return 0;
}
avatar
iamdsc_0410

Posts : 14
Join date : 2017-04-11
Age : 19
Location : IIIT Kalyani

View user profile

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum