C语言,输入五个国家的名字(英文),按字母顺序(即按ASCII码从小到大的顺序)排列输出
C语言,输入五个国家的名字(英文),按字母顺序(即按ASCII码从小到大的顺序)排列输出
#include <stdio.h> #include <string.h> typedef struct { char country[15]; } Country; Country raw[5]; Country *p[5]; void main() { Country *q; int i, j; printf("input countries:\n"); for (i = 0; i < 5; i++) { scanf("%s", raw[i].country); p[i] = &raw[i]; } for (i = 0; i < 4; i++) { for (j = 0; j < 4 - i; j++) { if (strcmp(p[j]->country, p[j + 1]->country) > 0) { q = p[j]; p[j] = p[j + 1]; p[j + 1] = q; } } } printf("\n"); for (i = 0; i < 5; i++) { printf("%s ", p[i]->country); } }
怎么样让自己游戏中的名字变成别的颜色?以红色为例:
1、首先我们要知道游戏中颜色的代码,这在网上都能找到,此处以红色为例,代码为:FF0000,打开游戏,点击本轮昵称。
2、将输入法调为英文输入,找到[]。
3、输入代码及昵称,代码必须在昵称前面。
4、退出后点击开始比赛。
5、可以看到名字颜色变为了红色。
0