博客
关于我
6.14编一个程序,将两个字符串s1和s2比较,不要用strcmp函数。
阅读量:369 次
发布时间:2019-03-05

本文共 428 字,大约阅读时间需要 1 分钟。

//C程序设计第四版(谭浩强)//章节:第六章 利用数组处理批量数据 //题号:6.14//题目:/*编一个程序,将两个字符串s1和s2比较,若s1>s2,输出一个正数;若s1=s2,输出0;若s1
<"C",应输出负数,同时由于‘A'与'C'的ASCII码差值为2,因此应输出“-2”。同理:“And”和“Aid”比较,根据第二个字符比较结果,“n”比“i”大5,因此应输出“5”。*/#include
#include
int main(){ char s1[50],s2[50]; int len1,len2,i,sum1=0,sum2=0,result; printf("input string1:\n"); gets(s1); printf("input string2:\n"); gets(s2); len1=strlen(s1); len2=strlen(s2); for(i=0;i

转载地址:http://fzag.baihongyu.com/

你可能感兴趣的文章
mysql 1593_Linux高可用(HA)之MySQL主从复制中出现1593错误码的低级错误
查看>>
mysql 5.6 修改端口_mysql5.6.24怎么修改端口号
查看>>
MySQL 8.0 恢复孤立文件每表ibd文件
查看>>
MySQL 8.0开始Group by不再排序
查看>>
mysql ansi nulls_SET ANSI_NULLS ON SET QUOTED_IDENTIFIER ON 什么意思
查看>>
multi swiper bug solution
查看>>
MySQL Binlog 日志监听与 Spring 集成实战
查看>>
MySQL binlog三种模式
查看>>
multi-angle cosine and sines
查看>>
Mysql Can't connect to MySQL server
查看>>
mysql case when 乱码_Mysql CASE WHEN 用法
查看>>
Multicast1
查看>>
mysql client library_MySQL数据库之zabbix3.x安装出现“configure: error: Not found mysqlclient library”的解决办法...
查看>>
MySQL Cluster 7.0.36 发布
查看>>
Multimodal Unsupervised Image-to-Image Translation多通道无监督图像翻译
查看>>
MySQL Cluster与MGR集群实战
查看>>
multipart/form-data与application/octet-stream的区别、application/x-www-form-urlencoded
查看>>
mysql cmake 报错,MySQL云服务器应用及cmake报错解决办法
查看>>
Multiple websites on single instance of IIS
查看>>
mysql CONCAT()函数拼接有NULL
查看>>