学习了一个星期了~天天看蓝框 很 纠结 程序发下来 这几天写的
#include<stdio.h>void main()
{
int a,b,c,i,p,z;
float s,d,f,x;
printf("the exe can printf many \nfirst \n");
do{
printf("1.bi da xiao\n2.nian fen\n3.pai xu\n4.tan qiou\n5. feng shu\n6.a+aa+aaa...=?\n");
scanf("%d",&a);
if(a==1)
{
do
{
printf("scanf there number the exe can bi da xiao\n");
scanf("%d",&a);scanf("%d",&b);scanf("%d",&c);
if(a>=b)
p=a;
else p=b;
if(b>=c)
z=b;
else z=c;
if(p>=z)
printf("the max is %d\n",p);
else printf("the max is %d\n",z);
printf("if you want next scanf 1(y) or 2(n)\n");
scanf("%d",&i);
}
while(i<=1);
printf("ok next\n");
}
if(a==2)
{
do
{
printf("the exe can printf rain \nscanf a year \n");
scanf("%d",&a);
if(a%4==0)
printf("%d is ",a);
else printf("%d is not ",a);
printf("rain\nif you want next scanf 1(y) or 2(n)\n");
scanf("%d",&i);
}
while(i<=1);
printf("ok next");
}
if(a==3)
{
do
{
printf("the exe can pai xu \n if you scanf number 1~3\nthe exe can scanf da to small\nps bu gou scanf 0\n");
scanf("%d",&a);scanf("%d",&b);scanf("%d",&c);
if(a<=b)
{ i=b;
b=a;
a=i;
}
if(a<=c)
{
i=c;
c=a;
a=i;
}
if(b<=c)
{
i=c;
c=b;
b=i;
}
printf("%d ",a);printf("%d ",b);printf("%d ",c);
printf("this is da xiao \nif you want next scanf 1(y) or 2(n)\n");
scanf("%d",&i);
}
while(i<=1);
printf(" next\n");
}
if(a==4)
{
do
{
a=0;d=0;s=0;f=0;
printf("scanf a number tian qiou gao du \n1.ci shu 2.gao du\n");
scanf("%d",&a);
scanf("%f",&d);
for(b=1;b<=a;)
{
s=d*2+s;
d=d/2;
b++;
}
f=s-100;
printf("zhong gong ju li %f\ngao du %f\n",f,d);
printf("the exe over \n next 1(y) or 2(n)\n");
scanf("%d",&i);
}
while(i<=1);
printf("over\n");
}
if(a==5)
{
do
{
printf("the exe can do feng shu jia fan \n scanf two number\n");
printf("1. feng zhi \n2. feng mu \n3. ci shu \n");
scanf("%f",&d);
scanf("%f",&f);
scanf("%d",&c);
for(i=1;i<=c;)
{
s=s+f/d;
x=f;
f=d+x;
d=x;
i++;
}
printf("he %f",s);
printf("the exe over \n next 1(y) or 2(n)\n");
scanf("%d",&i);
}
while(i<=1);
}
if(a==6){
do
{
printf("6.3 number jia fa \nscanf a=? the exe do a+aa+aaa....=?\n");
printf("scanf a=?\n");
scanf("%d",&a);
printf("scanf ci shu \n");
scanf("%d",&b);
c=0;p=a;
for(i=1;i<=b;)
{
c=c+p;
p=10*p+a;
i++;
}
printf("%d\n",c);
printf("the exe over \n next 1(y) or 2(n)\n");
scanf("%d",&i);
}
while(i<=1);
}
if(a==7){}
printf("the exe over \n next 1(y) or 2(n)\n");
scanf("%d",&i);
}
while(i<=1);
printf("bey bey\n");
}
由于 没办法 让结尾 输入 Y N 结束 只能用 1 2 了 一周了 还得加油 老强的书看着好烦啊 后面真难