|
发表于 2020-3-3 16:38:05
|
显示全部楼层
10个
10个
a,b,c
a=14,b=5,c=9
- if (size > 12)
- {
- cost = cost * 1.05;
- flag = 2;
- bill = cost * flag;
- }
- else bill = cost * flag;[code]if (ibex > 14)
- {
- sheds = 3;
- help = 2 * sheds;
- }
- else
- {
- sheds = 2;
- help = 2 * sheds;
- }[code]while(1)
- {
- readin: scanf("%d", &score);
- if (score < 0)
- {
- printf("count = %d\n", count);
- break;
- }
- count++;
- }[code]# include<stdio.h>
- int main(void)
- {
- float a,b,c;
- int i;
- printf("请输入小甲鱼和黑夜的初始资金:\n");
- scanf("%f",&a);
-
- b=c=a;
- for(i=1;b<=c;i++)
- {
- c = a*(1+0.1*i);
- b *=(1+0.05);
- }
- printf("%d年以后,黑夜的资产超过小甲鱼\n",i);
- printf("小甲鱼的资产是:%.2f\n黑夜的资产是:%.2f\n",c,b);
- return 0;
- }[code]# include<stdio.h>
- int main(void)
- {
- float lottery=400;
- int year = 0;
- while(lottery>0)
- {
- lottery = (lottery - 50)*(1+0.08);
- year ++;
- }
- printf("%d年后,小甲鱼败光所有家产,再次回到一贫如洗!\n",year);
-
-
- }[code]# include<stdio.h>
- # include<math.h>
- int main(void)
- {
- float pi = 1, a = 3;
- while(fabs(1/a)>10^(-8))
- {
- pi = pi + (-1/a);
- a = -(a+2);
- }
- printf("精确到小数后七位的圆周率是:%.7f",4*pi);
- return 0;
-
-
- }
复制代码 [/code][/code][/code][/code][/code] |
|