啊哈磊_编程从这里起步
标题:
课后练习循环问题
[打印本页]
作者:
傻瓜孩子
时间:
2013-12-26 20:02
标题:
课后练习循环问题
请问啊哈c这本书课后练习有答案吗?
怎么用while循环打印图形
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
作者:
李掌柜
时间:
2013-12-26 20:02
//一个比较正确的版本
#include<stdio.h>
int main(void)
{
int a,b,c;
a=1,b=1;
while(a<=5)
{
c=0;
while(c<a)
{
printf("%-3d",b++);
c++;
}
printf("\n");
a++;
}
return 0;
}
复制代码
作者:
超神级
时间:
2013-12-26 22:20
http://bbs.ahalei.com/thread-1340-1-1.html
作者:
超神级
时间:
2013-12-26 22:20
http://bbs.ahalei.com/thread-1340-1-1.html
作者:
SuperGsama
时间:
2014-1-24 21:26
为何我没找到答案- -
作者:
超神级
时间:
2014-1-24 23:34
SuperGsama 发表于 2014-1-24 21:26
为何我没找到答案- -
有的。
作者:
baibian11
时间:
2014-2-16 17:01
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a;
a=1;
while(a<=100)
{
printf("%d\n",a);
a=a+1;
}
system("pause");
return 0;
}
欢迎光临 啊哈磊_编程从这里起步 (https://bbs.codeaha.com/)
Powered by Discuz! X3.2