👌
1
{:5_102:}
‘’‘
嗯
1
0. 10
1. 10
2. c, b, a
3.
4. z = x >= 0 ? x: -x
5.
A. if(size > 12) {
cost = cost * 1.05;
flag = 2;
} else {
bill = cost * flag;
}
B. if(ibex > 14) {
sheds = 3;
} else {
sheds = 2;
help = 2 * sheds;
}
C. if(score < 0) {
printf("count = %d\n", count);
} else {
count ++;
scanf("%d", &score);
}
。
0.10
1.0
2.a = b;
b = c;
c= 5;
3.
0: 10
1: 10
2:
a=5
b=5
c=5
3:
a=4
b=3
c=8
4:
5:
A:
if (size > 12)
{
cost = cost * 1.05;
break;
}
flag = 2;
bill = cost * flag;
B:
if (ibex > 14)
{
sheds = 3;
break;
}
sheds = 3;
help = 2 * sheds;
C:
scanf("%d", &score);
if (score < 0)
{
printf("count = %d\n", count);
}
动动手:
0:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
double x=10000, y=10000,c=0;
for (int i = 1; i < 1000; i++)
{
c = 10000 * 0.1;
x = x + c;
y = y + y * 0.05;
if (y > x)
{
printf("%d年后y超越x\n",i);
printf("x=%f\ny=%f",x,y);
break;
}
}
return 0;
}
1:
double x=4000000, y=500000,c=0;
for (int i = 1; i < 1000; i++)
{
x = x - y;
x = x * 0.08 + x;
if (x<=0)
{
printf("%d年后破产",i);
break;
}
}
2:
double PI=(2/3), x=3,y=0;
for (int n = 1; n < 10000; n++)
{
if (n > 1)
{
x = x + 2;
if (n % 2 != 0)
{
PI = PI - (1 / x);
}
if (n % 2 == 0)
{
PI = PI + (1 / x);
}
}
printf("%.7f\n",PI);
}
#include<stdio.h>
int main()
{
float x, z;
printf("请输入数字:");
scanf("%f", &x);
if(x<0)
{
z = -x;
}
else
{
z = x;
}
printf("他的绝对值为%.2f", z);
return 0;
}if(size>12)
{
cost *= 1.05;
flag = 2;
}
bill = cost * flag;if(ibex>14)
{
sheds = 3;
}
else
{
sheds = 2;
}
help = 2 * sheds;while(a = scanf("%d", &score))
{
if(score<0)
{
printf("count = %d", count);
break;
}
else
{
count++;
}
}#include<stdio.h>
#include<math.h>
int main()
{
int year = 1;
float xjy, hy;
for(year = 1;year>=1;year++)
{
xjy = 10000 * (1 + 0.1 * year);
hy = 10000 * pow(1 + 0.05,year);
if(hy>xjy)
{
printf("%d年后,黑夜的投资额大于小甲鱼!\n", year);
printf("小甲鱼的投资额是:%.2f\n", xjy);
printf("黑夜的投资额是:%.2f", hy);
break;
}
}
return 0;
}#include<stdio.h>
#include<math.h>
int main()
{
int year;
double a;
for(year = 1; year>=1; year++)
{
a = 4000000 * pow(1.08,year)-500000 * (pow(1.08,year) * (1 - pow(1/1.08,year - 1)))/(1 - (1/1.08));
if(a<=0)
{
printf("%d年之后,小甲鱼败光了所有的家产,再次回到一贫如洗...", year);
break;
}
}
return 0;
}#include<stdio.h>
#include<math.h>
int main()
{
double a = 0;
int n;
for(n = 0;n>=0;n++)
{
a = (pow(-1,n))*1/(1 + 2*n) + a;
if(1/(1 + 2*n)<pow(10,-8))
{
printf("%.7f", 4*a);
break;
}
}
return 0;
}#include<stdio.h>
int main()
{
int a = 2, b = 1;
for(b = 1;b<=24;b++)
{
if(b<=4)
{
a = b * 2;
}
else
{
a = a + (b - 3)*2;
}
}
printf("两年后一共%d只兔子", a);
return 0;
}
10
10
a
1
..
0.100
1.10
2.c,b,a
3.16 6 11
4. z = x >= 0 ? x : -x;
5.if (size > 12)
{
cost = cost * 1.05;
flag = 2;
}
bill = cost * flag;
sheds = 2;
if (ibex > 14)
{
sheds = 3;
}
help = 2 * sheds;
while (readin)
{
if (score < 0)
{
printf("count = %d\n", count);
break;
}
count++;
readin = scanf("%d", &score);
_(:з」∠)_
1
{:5_102:}
.
31