关键是怎么弄呢?
如何加入到下面的代码里面去呢?
程序代码:
#include <stdio.h>
int main()
{
int j = 0;
printf("请确定棋手的级别:\n");
printf("1:9段 2:8段 3:7段 4:6段\n");
printf("5:5段 6:4段 7:3段 8:2段\n");
printf("9:1段\n");
printf("10:1级 11:2级 12:3级 13:4级\n");
printf("14:5级 15:6级 16:7级 17:8级\n");
printf("18:9级 19:10级 20:11级 21:12级\n");
printf("22:13级 23:14级 24:15级 25:16级\n");
printf("26:17级 27:18级\n");
scanf("%d", &j);
switch (j)
{
case 1: printf("棋手为:9段\n"); break;
case 2: printf("棋手为:8段\n"); break;
case 3: printf("棋手为:7段\n"); break;
case 4: printf("棋手为:6段\n"); break;
case 5: printf("棋手为:5段\n"); break;
case 6: printf("棋手为:4段\n"); break;
case 7: printf("棋手为:3段\n"); break;
case 8: printf("棋手为:2段\n"); break;
case 9: printf("棋手为:1段\n"); break;
case 10: printf("棋手为:1级\n"); break;
case 11: printf("棋手为:2级\n"); break;
case 12: printf("棋手为:3级\n"); break;
case 13: printf("棋手为:4级\n"); break;
case 14: printf("棋手为:5级\n"); break;
case 15: printf("棋手为:6级\n"); break;
case 16: printf("棋手为:7级\n"); break;
case 17: printf("棋手为:8级\n"); break;
case 18: printf("棋手为:9级\n"); break;
case 19: printf("棋手为:10级\n"); break;
case 20: printf("棋手为:11级\n"); break;
case 21: printf("棋手为:12级\n"); break;
case 22: printf("棋手为:13级\n"); break;
case 23: printf("棋手为:14级\n"); break;
case 24: printf("棋手为:15级\n"); break;
case 25: printf("棋手为:16级\n"); break;
case 26: printf("棋手为:17级\n"); break;
case 27: printf("棋手为:18级\n"); break;
}
return 0;
}
[此贴子已经被作者于2018-7-16 20:31编辑过]