当前位置:网站首页>Class is coming. Roll call is needed
Class is coming. Roll call is needed
2022-07-19 06:54:00 【winkiii】
describe
Xiao Fan's teacher always calls the roll before class , But this wastes the teacher's class time . So the teacher asked Xiao Fan to finish the roll call , Let Xiao Fan order a good name when he studies by himself in the morning . The teacher gave Xiao Fan a list , Xiao Fan just needs to call the roll according to the list. Isn't it very simple .
Input
Input has multiple sets of data , Until the end of the document . Each set of test data has three lines , The first line is two integers m, n(50 >= m >= n). The second line has m A name , The names are separated by spaces , It's the list of Xiao Fan's classmates . In the back n The first name is the classmate who came to class . The names are separated by spaces . The length of the name does not exceed 20 Characters .
Output
Follow the list on the first line , Whether everyone's corresponding output has arrived . Output of people to Yes, People who don't arrive output No.
sample input 1
3 2
Bob Marry Jam
Bob Jam
2 2
Limeme Lintianzhi
Limeme Lintianzhi
sample output 1
Yes
No
Yes
Yes
Yes
#include<stdio.h>
#include<string.h>
int main(){
int m,n;
int i,j;
char s[50][51],p[50][51];
while(scanf("%d%d",&m,&n)!=EOF){
for(i=0;i<m;i++){
scanf("%s",s[i]);
}
for(j=0;j<n;j++){
scanf("%s",p[j]);
}
for(i=0;i<m;i++){
for(j=0;j<n;j++){
if(strcmp(s[i],p[j])==0){
printf("Yes\n");
break;
}
}
if(j==n){
printf("No\n");
}
}
}
}
边栏推荐
- What is tsd/qsd? What is CS Genesis SD NAND?
- Talk about Zhongtai: my understanding and thinking about Zhongtai
- Causes and solutions of over fitting
- mysql的复习总结
- Arabic numerals to Chinese
- Pytorch deep learning practice-b station Liu erden-day6
- wireshark抓包:报文信息
- Sed command of text three swordsman -- text replacement; Grep command - text filtering
- Gentoo安装教程(Systemd+Gnome)
- Good partner of single chip microcomputer - CS Genesis SD NAND flash
猜你喜欢
高并发day02(Concurrent包)
高并发day01(NIO、ConCurrent包)
Machine learning - classification prediction of logistic regression
Pytorch deep learning practice-b station Liu erden-day6
开发板训练:STM32下的多任务程序
Generate audio and waveform in PWM and DAC exercises of stm32
双代号时标网络图
Wu Enda machine learning chapter 14-15
小迪网络安全-笔记(5)
Wireshark packet capturing: error analysis
随机推荐
Text three swordsman's awk command -- interception
Wireshark packet capturing: error analysis
Release nohup Out disk space occupied
linxu下调试微信调一跳(Fedora 27)
Alien Slackware
OLED data display based on spi/iic interface
解决sonar的单元测试的覆盖率会为0问题
小迪网络安全笔记-信息收集-架构、搭建、waf(8)
小迪网络安全-笔记(2)
Flip linked list
Gentoo安装教程(Systemd+Gnome)
总价合同、成本补偿合同、工料合同
Common user password encryption methods and cracking methods
上课啦要点名啊
Good partner of single chip microcomputer - CS Genesis SD NAND flash
Wu Enda machine learning chapter 14-15
redis
逃出湖心(数学题)
Learning about STM assembler design
Tcp/ip four layer model and related configurations of F5