如何使用for循环或while循环按顺序编写?
示例
#include
#include
void main() {
int i,j,a=0,b=1,n;
clrscr();
printf("****************OUTPUT*****************\n\n");
printf("enter the value of n : ");
scanf("%d",&n);
printf("\n the required order is: \n\n" );
for(i=1;i<=n;i++) {
if(i==1)
printf("%d. E",i);
else {
printf("%d. ",i);
for(j=1;j<=i-1;j++)
printf("%d",a);
for(j=1;j<=i-1;j++)
printf("%d",b);
}
printf("\n");
}
getch();
}热门推荐
10 财运虎年祝福语简短语
11 单亲爸爸春节祝福语简短
12 狗狗上厕所训练
13 植物种植祝福语简短
14 翻译考试祝福语朋友简短
15 个人周年庆简短祝福语
16 狗狗怎么训练
17 分别祝福语简短搞笑英文
18 生日广州男生祝福语简短