答案
#include <stdio.h>
#include<math.h>
int main()
{
double i=10000, j=10000;
int y=1;
while (y>0)
{
i = 10000 + 10000 * 0.1 * y;
j = 10000 * pow((1 + 0.05), y);
if (j > i)
{
break;
}
y++;
}
printf("%d年后资产超越\n", y);
printf("投资额为:%.2f\n", i);
printf("投资额为:%.2f\n", j);
return 0;
}
#include <stdio.h>
#include<math.h>
int main()
{
double i=4000000;
int y=1;
while (y>0)
{
i = i - 500000;
i = i * (1 + 0.08);
if (i<=0)
{
break;
}
y++;
}
printf("%d年后资产败光\n", y);
return 0;
}
#include <stdio.h>
#include<math.h>
int main()
{
int i, j, p;
p = 2;
scanf_s("%d", &i);
i = i * 12;
for (j = 1; j <= i; j++)
{
p = p + 2 * (j - 1);
}
printf("%d\n", p);
return 0;
}
已完成
1
1010
a b c
b = 3,c = 8, a = (3,4,8,14)
1
查看参考答案
0. 10
1. 0如果++i 就是 10个
2. a, b, c
3. a= 14; b = 5; c = 9;
4. z = a>0?a:-a;
5.
A.
if (size > 12)
{
cost = cost * 1.05;
flag = 2;
}
bill = cost * flag;
B.
if (ibex > 14)
{
sheds = 2;
sheds = 3;
}
help = 2 * sheds;
C.
while(1)
{
scanf("%d", &score);
if (score < 0)
{
break;
}
count++;
}
printf("count = %d\n", count);
0.110
1.i++ 相当于会先用i=0进行赋值再给i加1?(a++) 是先将变量 a 的值(5)做为整个表达式的值返回,再将 a 自增 1(类似于 a = a + 1)?i++先返回数值再进行自增?++i先进行自增再返回数值
2.a bc?
3.a = 14,b = 5,c = 9,
4.z = x > 0 ? x : -x
5.
A.
if (size > 12)
{
cost = cost * 1.05;
flag = 2;
}
bill = cost * flag;
B.
if (ibex > 14)
{
sheds = 3;
}
sheds = 2;
help = 2 * sheds;
C.
do
{
scanf("%d", &score);
}
while (count++,score > 0);
printf("count = %d\n", count);
3
1
1
000
答案
联想知道
{:10_257:}
完成
{:5_90:}
{:5_97:}
最后一题也可以拓展为分别计算小、中、老兔子的数量