| 
 | 
 
 
发表于 2022-9-21 20:38:07
|
显示全部楼层
 
 
 
0.10次 
1.0次 
2.a 
3.a=14 
b=5, 
c=9 
4.x>0?x:(-x) 
5. 
if(size>12) 
{ 
        cost=cost*1.05; 
        flag=2; 
} 
bill=cost*flag; 
 
if(ibex>14) 
{ 
        sheds=3; 
} 
sheds=2; 
help=2*sheds; 
 
 
if(score<0) 
{ 
        printf("count=%d\n",count); 
} 
count++; 
scanf("%d",&score); 
 
 
0.#include<stdio.h> 
int main() 
{ 
        float a=10000,b,c; 
        int i=0; 
        for(b=a,c=a;b>=c;) 
        { 
                b=b+a*0.1; 
                c=c+c*0.05; 
                if(b>=c) 
                { 
                        i++; 
                } 
        } 
        printf("%d年后,黑夜的投资额超过小甲鱼。\n",i); 
        printf("小甲鱼的投资额是%.2f,黑夜的投资额是%.2f。",b,c); 
}  
 
1.#include<stdio.h> 
int main() 
{ 
        float a=400,b=50; 
        int c=0; 
        while(a>0) 
        { 
                a=a*(1+0.08)-50; 
                c++; 
        } 
        printf("%d年后,小甲鱼败光家产,再次回到一贫如洗的状态。",c-2); 
} 
 
2.#include<stdio.h> 
#include<math.h> 
int main() 
{ 
        double a,b,c,d,e; 
        for(a=1,b=1,c=1,d=-1,e=0;(d>pow(10,(-8))*(-c)&&c<0)||(d<pow(10,(-8))*(-c)&&c>0);) 
        { 
                d=a/b*c; 
                b=b+2; 
                c=c*(-1); 
                if((d>pow(10,(-8))*(-c)&&c<0)||(d<pow(10,(-8)*(-c))&&c>0)) 
                e=e+d; 
        } 
        printf("%.7f\n",e); 
} 
 
3.#include<stdio.h> 
int main() 
{ 
        int a,b; 
        for(a=1,b=1;b<12*2;b++) 
        { 
                a=a*2; 
        } 
        printf("一共%d个兔子",a); 
} |   
 
 
 
 |