# 13290 - Matching Strings >author: Utin ###### tags: `string` --- ## Brief See the code below ## Solution 0 ```c= #include<stdio.h> #include <string.h> char s1[101][1001], s2[101][1001]; int main() { int n, m; char ans[101] = {0}; scanf("%d %d", &n, &m); for(int i=0; i<n; i++) { scanf("%s", &s1[i][0]); } for(int i=0; i<m; i++) { scanf("%s", &s2[i][0]); } for(int i=0; i<m; i++) { for(int j=0; j<n; j++) { if(strcmp(s2[i], s1[j]) == 0) { ans[i] = 1; break; } } } for(int i=0; i<m; i++) { if(ans[i] == 1) printf("Yes"); else printf("No"); printf("\n"); } } // By Utin ``` ## Reference
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up