当前位置:网站首页>求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
边栏推荐
- 面试学习路线
- yum源仓库本地搭建的两种方法
- Ctf-misc learning from start to give up
- STO With Billing 跨公司库存转储退货
- Expression related to month, year and day in SVG
- String self generated code within a given range
- VBA调用SAP RFC实现数据读取&写入
- Internal network security attack and defense: a practical guide to penetration testing (VII): cross domain attack analysis and defense
- Cloud computing skills competition -- Part 2 of openstack private cloud environment
- BUUCTF MISC刷题
猜你喜欢
Teach-Repeat-Replan: A Complete and Robust System for Aggressive Flight in Complex Environments
Chapter V investment real estate
Unity get real geographic map application terrain notes
[NLP notes] preliminary study on CRF principle
CTF attack and defense world brush questions 51-
三分钟教你用Houdini流体>>解算粒子流体水滴
Dvwa 靶场练习记录
內網滲透系列:內網隧道之icmpsh
Online Safe Trajectory Generation For Quadrotors Using Fast Marching Method and Bernstein Basis Poly
Redis -- why is the string length of string emstr the upper limit of 44 bytes?
随机推荐
Feign源码分析
strcat()、strcpy()、strcmp()、strlen()
Personality charm of high paid it workers
Search and replacement of C text file (WinForm)
数据库之MySQL——基本常用查询命令
Intranet penetration series: icmpsh of Intranet tunnel
MYSQL——第一章节(数据类型2)
Internal network security attack and defense: a practical guide to penetration testing (5): analysis and defense of horizontal movement in the domain
内网渗透系列:内网隧道之icmptunnel(jamesbarlow师傅的)
When using flash, the code ends automatically without an error, the connection cannot be maintained, and the URL cannot be accessed.
一些靶场的学习记录:sqli-labs、upload-labs、XSS
内网渗透系列:内网隧道之dnscat2
面试学习路线
BUUCTF MISC刷題
What's new in. Net 5 NET 5
BUUCTF MISC刷题
Reading notes
Research on system and software security (5)
C read INI file and write data to INI file
Research on system and software security (2)