给个简单点的 你 ,
#include<stdio.h>
main()
{
int a;
scanf("%d",&a);
switch(a)
{
case:1;
printf("1\n");break;
case:2;
printf(" 1\n");
printf("121\n");break;
case:3;
printf("
1\n");
printf(" 121\n");
printf("12321\n");break;
case:4;
printf("
1\n");
printf("
121\n");
printf(" 12321\n");
printf("1234321\n");break;
case:5;
printf("
1\n");
printf("
121\n");
printf("
12321\n");
printf(" 1234321\n");
printf("123454321\n");break;
case:6;
printf("
1\n");
printf("
121\n");
printf("
12321\n");
printf("
1234321\n");
printf(" 123454321\n");
printf("12345654321\n");break;
case:7;
printf("
1\n");
printf("
121\n");
printf("
12321\n");
printf("
1234321\n");
printf("
123454321\n");
printf(" 12345654321\n");
printf("1234567654321\n");break;
case:8;
printf("
1\n");
printf("
121\n");
printf("
12321\n");
printf("
1234321\n");
printf("
123454321\n");
printf("
12345654321\n");
printf(" 1234567654321\n");
printf("123456787654321\n");break;
case:9;
printf("
1\n");
printf("
121\n");
printf("
12321\n");
printf("
1234321\n");
printf("
123454321\n");
printf("
12345654321\n");
printf("
1234567654321\n");
printf(" 123456787654321\n");
printf("12345678987654321\n");break;
default:printf("输入1~9的数")
}
}
[
本帖最后由 z1191387820 于 2010-1-12 18:51 编辑 ]