HIT习题系统包括大量编程题,每个题目包含ID、两个类型标签(标签中没有空格)、难度(值为1-5的整数)等多种信息,请输入若干题目的信息,然后输入一个类型标签和难度等级,给出所有带有该类型标签,满足该难度等级的题目ID,如果没有匹配的题目则什么也不输出。请采用下面的结构体类型来存储题目信息: typedef struct question { int ID; char label1[20]; char label2[20]; int level; }Question; 输入格式: 1)先输入题目个数:%d 2)再输入每个题目ID、标签1、标签2,用空格分隔,格式: "%d%s%s%d" 3)之后要查找的类型标签和难度,用空格分隔:"%s%d" 输出格式:%d\n 程序运行示例1: 3↙ 1001 loop string 3 1002 struct linklist 4↙ 1003 string struct 3↙ string 3↙ 1001 1003 程序运行示例2: 4↙ 1001 struct loop 4↙ 1002 string loop 2↙ 1003 struct linklist 3↙ 1004 array loop 1↙ struct 5↙
附加错:使用动态存储结构设计一个通讯录,并可以对用户的电话号码进行更新。每位联系人包括姓名和电话两类信息,其中姓名和电话都不超过20个字符。首先输入联系人个数,然后创建每位联系人的信息,接着输入需要更新的联系人的姓名,查找此联系人是否存在,若存在则更新其电话信息。 程序运行示例1: Please input the number of contact:2↙ Please input number 1 friend's name:Oswald↙ Please input number 1 friend's telephone:12345678910↙ Please input number 2 friend's name:Kai↙ Please input number 2 friend's telephone:1472583690↙ Please input the name that you want to look for:Kai↙ Please input the telephone that you want to update:3692581470↙ the telephone is 3692581470 after updating. 程序运行示例2: Please input the number of contact:2↙ Please input number 1 friend's name:tom↙ Please input number 1 friend's telephone:1234↙ Please input number 2 friend's name:jack↙ Please input number 2 friend's telephone:5678 Please input the name that you want to look for:rose↙ No this one!
输入两个字符串a,b,如果第一个字符串a中含有空格符,则用字符串b替换字符串a中的空格,否则保持a不变。最终得到替换后的新字符串c,并输出。要求: 1用gets函数得到从键盘输入的字符串; 2. 字符串a,b的长度最大为100,定义宏maxLength表示最大长度,新字符串c的最大长度为maxLength* maxLength 输入提示信息: "Input the first str:" "Input the second str:" 输出提示信息: "New str:" 输出格式:"%s" 程序运行示例1(有2个空格): Input the first str:abc 123 dd↙ Input the second str:YYY↙ New str:abcYYY123YYYdd 程序运行示例2(没有空格): Input the first str:abc↙ Input the second str:yy↙ New str:abc 程序运行示例3(有3个空格): Input the first str:abc 123↙ Input the second str:yy↙ New str:abcyyyyyy123
附加改错题:用结构体编程实现输入3个人员的姓名及手机号码(中国大陆的手机号都是11位,如果用户输入的不是11位,则请用户重新输入), 然后输入一个人的姓名,查找该人对应的电话。 程序运行示例1: Please input name:wang hong↙ Please input telephone:123456↙ Please input telephone:13904517338↙ Please input name:li wei↙ Please input telephone:15104218888↙ Please input name:tian yu↙ Please input telephone:13656668888↙ Please input find name:wang hong↙ The telephone is 13904517338 程序运行示例2: 输入: Please input name:wang hong↙ Please input telephone:123456↙ Please input telephone:13904517398↙ Please input name:li wei↙ Please input telephone:15104218868↙ Please input name:tian yu↙ Please input telephone:13656668888↙ Please input find name:zhang yan↙ Not found!
为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!