当前位置:网站首页>求3个字符串(每串不超过20个字符)中的最大者。
求3个字符串(每串不超过20个字符)中的最大者。
2022-04-23 06:38:00 【laocooon】
#include <stdio.h>
#include <string.h>
void main()
{ char s[20],string[3][20];
int i;
for (i=0; i<3 ;i++)
gets(string[i]);//string
if(strcmp(string[0],string[1])>0)//string[0][0]>string[1][0]
strcpy(s,string[0]);
else
strcpy(s,string[1]);
if(strcmp(string[2],s)>0)
strcpy(s,string[2]);
printf("%s",s);//printf(s);
}
版权声明
本文为[laocooon]所创,转载请带上原文链接,感谢
https://laocooon.blog.csdn.net/article/details/124356646
边栏推荐
- 从零开始完整学习机器学习和深度学习,包括理论和代码实现,主要用到scikit和MXNet,还有一些实践(kaggle上的)
- 1+x云计算中级--脚本搭建读写分离
- Redis transaction implements optimistic locking principle
- Buuctf misc brush questions
- CTF attack and defense world brush questions 51-
- 《内网安全攻防:渗透测试实战指南》读书笔记(四):权限提升分析及防御
- What's new in. Net 5 NET 5
- Redis -- why is the string length of string emstr the upper limit of 44 bytes?
- CTF攻防世界刷题51-
- Internal network security attack and defense: a practical guide to penetration testing (IV): Authority improvement analysis and defense
猜你喜欢
Sto with billing cross company inventory dump return
[极客大挑战 2019]Havefun1
Internal network security attack and defense: a practical guide to penetration testing (5): analysis and defense of horizontal movement in the domain
When using flash, the code ends automatically without an error, the connection cannot be maintained, and the URL cannot be accessed.
《内网安全攻防:渗透测试实战指南》读书笔记(八):权限维持分析及防御
Chapter IV intangible assets
Feign源码分析
SAP GUI security
yum源仓库本地搭建的两种方法
CTF attack and defense world brush questions 51-
随机推荐
String self generated code within a given range
[NLP notes] preliminary study on CRF principle
VBA调用SAP RFC实现数据读取&写入
Complete learning from scratch, machine learning and deep learning, including theory and code implementation, mainly using scikit and mxnet, and some practices (on kaggle)
KCD_ EXCEL_ OLE_ TO_ INT_ Convert reports an error sy subrc = 2
Sto with billing cross company inventory dump return
读书笔记
面试学习路线
云计算赛项--2020年赛题基础部分[任务3]
Go语学习笔记 - 异常处理 | 从零开始Go语言
KVM安装部署
Zhuang understand's TA notes (VI) < fakeenvreflect & rust, rust effect >
Intranet penetration series: icmpsh of Intranet tunnel
SAP GUI安全性
云计算技能大赛 -- openstack私有云环境 第二部分
Research on software security based on NLP (2)
雲計算技能大賽 -- openstack私有雲環境 第一部分
VBA調用SAP RFC實現數據讀取&寫入
strcat()、strcpy()、strcmp()、strlen()
C read INI file and write data to INI file