可爱小奥比


私信TA

用户名:l784669877

访问量:809

签 名:

等  级
排  名 14591
经  验 819
参赛次数 0
文章发表 7
年  龄 0
在职情况 学生
学  校 天津科技大学
专  业

  自我简介:

TA的其他文章

#include <stdio.h>

#include <string.h>

#define SIZE 3

#define LEN 81


int main(void)

{

char ch[SIZE][LEN];

char* temp[SIZE];

char* pch;

int i,j;

for (i = 0; i < SIZE; i++)

{

gets(ch[i]);

temp[i] = ch[i];

}

for (i = 0; i < SIZE - 1; i++)

{

for (j = i + 1; j < SIZE; j++)

{

if (strcmp(ch[i], ch[j]) > 0)

{

pch = temp[i];

temp[i] = temp[j];

temp[j] = pch;

}

}

}

for (i = 0; i < SIZE; i++)

puts(temp[i]);

return 0;

}


 

0.0分

1 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换

万能编程问答

代码解释器

  评论区