写不出 我得看看
{:10_249:}
埃里克房间内安抚发生
kkkk
答案
{:5_91:}
see
111
本帖最后由 kant1943 于 2018-6-19 23:39 编辑
#include <stdio.h>
int f(int i)
{
if(i == 1 || i == 2)
{
return 1;
}
else
{
returnf(i-1) + f(i-2);
}
}
int main()
{
int n = 24;
printf("%ld\n", f(24));
return 0;
}
本帖最后由 Seerz 于 2018-6-20 10:31 编辑
0. 10个
1. 0个
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 = 3;
}
sheds = 2;
help = 2 * sheds;
C.
while(1)
{
readin: scanf("%d", &score);
if (score < 0)
{
break;
}
count++;
}
printf("count = %d\n", count);
动动手
0. #include <stdio.h>
/*
A,B 手上各有100000元,A固定年利10%投资,B复利5%投资,多久B超过A?
*/
int main(int argc, char const *argv[])
{
float planA=100000,planB=100000;
int n=0;
while(planA>=planB)
{
planB *= 1.05;
planA = planA + 100000 * 0.1;
n++;
}
printf("第%d年,B投资获利%.2f元,超过A投资获利%.2f元\n", n, planB, planA);
return 0;
}
1. #include <stdio.h>
/*
400万元,每年拿走50,剩下做8%定期理财,多久财产归零。
*/
int main(int argc, char const *argv[])
{
float property = 400;
int n=0;
while (property >= 0)
{
property -= 50;
property *= 1.08;
n++;
}
printf("第%d年,财产归零\n", n);
return 0;
}
2. #include <stdio.h>
#include <math.h>
/*
已知公式 pi/4 = 1 - 1/3 + 1/5 - 1/7 + 1/9 ...
求pi
精确到小数位7
*/
int main(int argc, char const *argv[])
{
double result = 0, pi, denominator = 1;
while(denominator < 100000000)
{
result =- result + (1/denominator);
denominator += 2;
}
pi = fabs(4 * result);
printf("圆周率为%.7f\n", pi);
return 0;
}
3. #include <stdio.h>
#include <math.h>
/*
一对兔子,每月可繁殖2一对兔子,小兔子两个月后有繁殖能力,若都健康2年,将繁殖多少对兔子。
*/
int main(int argc, char const *argv[])
{
int n = 3, sum = 0, a=1,b=2;
for (n; n<= 24; n++)
{
sum = a + b;
a = b;
b = sum;
}
printf("2年后一共%d\n对兔子", sum);
return 0;
}
谢谢
朕想知道
0.10个
1.11个
2.a b c
3.a = 9
b = 5
c = 4
4.z = x > 0 ? x : (-x)
5.
学习学习
{:5_91:}
SIE16,哈哈哈哈,继续努力
答案
看
看答案{:10_280:}
只想知道