皮皮学,免费搜题
登录
搜题
【简答题】
//【E11_2.c】 输入三个字符串,利用字符串处理的相关函数,求出其中的最大者。 //字符串输入输出函数:gets(),puts() //字符串赋值函数:strcpy(),strcat() //字符串比较函数:strcmp() /* 输入: I am a student I am learning C programing I hope to get good result 输出: The MAX string is: I hope to get good result */ #include #include void main() { char str[3][40]; //存放三个字符串;注意单个字符串长度不得大于40 char maxstr[40]; //存放最大字符串 int i; //输入三个字符串分别放到str[0],str[1],str[2] printf("Please input 3 strs(End with Enter):\n"); for(i=0;i<3;i++) { gets(【空1】); } //分行输出三个字符串 printf("You just input the 3 strs are:\n"); for(i=0;i<3;i++) { puts(str[i]); } //寻找最大的字符串 printf("Now will finding the MAX string...\n"); if(【空2】) //比较str[0],str[1] strcpy(maxstr,str[0]); else strcpy(maxstr,str[1]); if(strcmp(str[2],maxstr)>0) 【空3】; //得到maxstr的最终赋值 //输出最大的字符串 printf("The MAX string is:\n%s\n",maxstr); }
拍照语音搜题,微信中搜索"皮皮学"使用
参考答案:
参考解析:
知识点:
.
..
皮皮学刷刷变学霸
举一反三
【单选题】There are many in this hospital.
A.
woman doctor
B.
women doctor
C.
women doctors
【判断题】如果以鼠标击点为中心绘制矩形、椭圆及圆角矩形,使用工具的同时按Shift键就可实现
A.
正确
B.
错误
【简答题】听短文,完成下面表格。 Hospital rules This hospital can hold (1)_________ patients. There are eight beds in each room. You are allowed to visit patients (2)________(times) a day. Only (3)________ people can see ...
【判断题】企业应当根据国家有关法令、法规,并结合企业实际情况来制订自己的成本会计工作制度或方法。
A.
正确
B.
错误
【单选题】风格派设计主要起源于_____
A.
俄国
B.
法国
C.
意大利
D.
荷兰
【单选题】Only By increasing the numBer of doctors By 50 percent properly in this hospital.
A.
can Be the patients
B.
can the patients Be treated
C.
the patients can Be treated
D.
treated can Be the patients
【判断题】企业应当根据国家有关法令、法规,并结合企业实际情况来制定自己的成本会计工作制度或方法。
A.
正确
B.
错误
【单选题】5~26.基尔霍夫定律的节点电流定律也适合任意( )。
A.
封闭面
B.
短路
C.
开路
D.
连接点
【单选题】风格派设计主要起源于_____。
A.
荷兰
B.
俄国
C.
意大利
D.
西班牙
【单选题】发车计划由()根据列车运行图、运营检修用车安排、车场线路存车情况等编制。
A.
值班主任
B.
行车值班员
C.
行车调度员
D.
车场调度员
相关题目: