#include <stdio.h>#include <string.h> int main(){ char a[100]; char b[100]; char ...
输入 个字符串,按由小到大的顺序输出 include lt iostream gt include lt string gt using namespace std void main void swap char str ,char str char stg ,stg ,stg cout lt lt 请输入 个字符串,我来比较大小: lt lt endl include lt string g ...
2012-05-02 12:41 0 11975 推荐指数:
#include <stdio.h>#include <string.h> int main(){ char a[100]; char b[100]; char ...
输入3个字符串,要求按由小到大的顺序输出 解题思路: 字符串的比较可以使用strcmp函数,返回值>0表示大于,返回值小于0表示小于,返回追等于0表示相同。其他的比较排序思路与数字的排序交换没有区别,逐个进行比较先找出最大的,然后找出第二大的。 答案: ...
输入3个字符串,要求按由小到大的字母顺序输出 如 输入franch england china,输出结果是china england franch 三个数排序输出,比较三个数的大小怎么做? a=18 b= 9 c=30 a>b 交换 a=9 b=18 可不可以用选择法?可不可以 ...
...
#include <stdio.h>#include <string.h>int main(){ char a[10],b[10],c[10],t[10]; int x,y,z ...
include <stdio.h> include <stdlib.h> include <string.h> void swap(char** a,char** b)//输入的参数是二级指针(指针的地址) { char* temp;//对指针(内容的地址 ...