1.用十进制、八进值、十六进制、字符形式输出ASCII码表33~126中的代码。
#include <stdio.h>
main()
{
int i=33;
while(i<=126)
{
printf("%d,%o,%x,%c\n",i,i,i,i);
i++;
}
}
2.计算1!+2!+… …+10!的值
#include <stdio.h>
main()
{
int i=1,n=1,sum=0;
for(i=1;i<=10;i++)
{
n=n*i;
sum=sum+n;
}
printf("1!+2!+… …+10!的值为:%d\n",sum);
}
3.用循环的嵌套输出下方图形:
*
***
*****
*******
*********
***********
#inclu