forgetbig
发表于 2023-1-8 00:52:05
答案
Pineapple_Li
发表于 2023-1-8 17:19:19
S1E16
hxp7029703
发表于 2023-1-8 19:52:57
0.90次
1.10次
2.5
3.a=5,b=5,c=9
4.fabs(x)
5.a.if (size>12)
{
cost=cost*1.05;
flag=2;
}
bill=cost*flag;
b.
Alkaaaid
发表于 2023-1-10 16:52:31
{:10_282:}
GAkki4ever
发表于 2023-1-10 17:16:20
6
zhangziyi
发表于 2023-1-10 19:46:58
{:5_109:}
Sunxiaosong
发表于 2023-1-11 09:22:07
#include <stdio.h>
int main()
{
double jiayu = 10000;
double heiye = 10000;
int year = 0;
while (heiye <= jiayu) {
jiayu += 10000 * 0.1;
heiye +=heiye * 0.05;
year++;
}
printf("%d年后,黑夜的投资额超过小甲鱼!\n", year);
printf("小甲鱼的投资额是:%.2f\n", jiayu);
printf("黑夜的投资额是:%.2f\n", heiye);
return 0;
}
#include <stdio.h>
int main()
{
long double money = 4000000;
int year = 0;
while (money > 0) {
money -= 500000;
money *= 1.08;
year++;
}
printf("%d年之后,小甲鱼败光了所有的家产,再次回到一贫如洗...\n", year);
return 0;
}
#include <stdio.h>
int main()
{
double res;
double i, denominator;
for(i = 1, denominator = 1; denominator <= 1000; i = -i, denominator += 2) {
//printf("%d %d", i, denominator);
res += i / denominator;
}
printf("res = %.2f\n", res * 4);
return 0;
}
乌洛托品
发表于 2023-1-11 16:48:37
1
jackyxch
发表于 2023-1-11 21:24:41
1
KKMUHAN
发表于 2023-1-12 00:13:55
1
jwsn
发表于 2023-1-12 16:01:25
#include <stdio.h>
#include <math.h>
int main()
{
int i;
float hei=10000;
float yu=10000;
for(i=1;hei<=yu;i++)
{
yu=10000+i*(10000*0.1);
hei=10000*(pow((1+0.05),i));
}
printf("%d,yu=%.2f,hei=%.2f\n",i,yu,hei);
return 0;
}
蔚然的成风
发表于 2023-1-12 20:07:37
0.
100遍
1.
0个
2.
a,b,c
3.
a == 14
b == 5
c == 9
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.
#include <stdio.h>
int main()
{
int year = 0;
float m_fish = 10000, m_night = 10000;
do
{
year++;
m_fish = 0.1*10000 + m_fish;
m_night = m_night + m_night*0.05;
}
while (m_fish > m_night);
printf("%dÄêoó£¬oúò1μÄí¶×ê¶î3¬1yD¡¼×ó㣡\n",year);
printf("D¡¼×óãμÄí¶×ê¶îêÇ£o%.2f\n", m_fish);
printf("oúò1μÄí¶×ê¶îêÇ£o%.2f\n", m_night);
return 0;
}
1.
#include <stdio.h>
int main()
{
float money;
int year;
for (money = 400, year = 0; money > 0; year++)
{
money -= 50;
money = money*1.08;
}
printf("%dÄêÖ®oó£¬D¡¼×óã°ü1aáËËùóDμļò2ú£¬Ôù′λØμ½ò»Æ¶èçÏ′......\n",year);
return 0;
}
2.
#include <stdio.h>
#include <math.h>
int main()
{
int i=1;
double j=1, sum=0,temp1;
while (fabs(j) > 10^(-8))
{
sum = sum + j;
i++;
if( 0 == i % 2)
{
temp1 = i+2;
temp1 = -temp1;
}
else
{
temp1 = i+2;
}
j = 1 / temp1;
}
sum *= 4;
printf("PiμÄÖμêÇ%.7f",sum);
return 0;
}
3.
#include <stdio.h>
#include <math.h>
int main()
{
long long i;
i = pow(2,23);
printf("两年后约有%lld只兔子",i);
return 0;
}
hfhgjgjk
发表于 2023-1-12 23:04:39
有梦想的student
发表于 2023-1-13 11:32:00
1
积极废人__
发表于 2023-1-13 14:52:59
1
TTxxTT
发表于 2023-1-13 16:46:31
0.
#include <stdio.h>
#include <math.h>
int main()
{
int i=0,xjy=10000;
float hy=10000;
for(i=1;;i++)
{
xjy+=10000*0.1;
hy*=1.05;
if(hy>=xjy) break;
}
printf("%d年后,黑夜的投资额超过小甲鱼!\n",i);
printf("小甲鱼的投资额是:%d\n",xjy);
printf("黑夜的投资额是:%.2f\n",hy);
return 0;
}
1.
#include <stdio.h>
int main()
{
int i;
float money=4000000;
for(i=1;;i++)
{
money-=500000;
money*=1.08;
if(money<=0) break;
}
printf("%d年之后,小甲鱼败光了所有的家产,还剩%f元\
,再次回到一贫如洗……\n",i,money);
return 0;
}
2.
#include <stdio.h>
#include <math.h>
int main()
{
int i=1,j=-1,fm;
double pi_4=0;
float fz=1.0;
for(i=1;;i++)
{
fm=2*i-1;
j=-j;
pi_4+=j*fz/fm;
if(fabs(4*pi_4-3.1415926)<(1.0/100000000)){
break;
}
}
printf("当i=%d,分母为%d时,PI的近似值为%.7f\n",i,2*i-1,4*pi_4);
return 0;
}
3.
#include <stdio.h>
int main()
{
int i,sum=1,newrabbit=1,oldrabbit=0,temp=0,month;
printf("请输入月数:");
scanf("%d",&month);
for(i=1;i<month;i++)
{
temp=oldrabbit;
oldrabbit=oldrabbit+newrabbit;
newrabbit=temp;
sum=oldrabbit+newrabbit;
}
printf("第%d个月兔子对数达到%d\n",i,sum);
return 0;
}
zero_GK397
发表于 2023-1-14 14:18:45
#include<stdio.h>
int main(){
int year = 0;
double jia = 10000, hei = 10000;
do{
jia += 10000 * 0.1;
hei += hei * 0.05;
year++;
}while(jia > hei);
printf("%d年后,黑夜投资额超过小甲鱼!\n", year);
printf("小甲鱼的投资额是:%.2f\n", jia);
printf("黑夜的投资额是:%.2f\n", hei);
return 0;
}
zero_GK397
发表于 2023-1-14 14:26:43
#include<stdio.h>
int main(){
long money = 4000000;
int year = 0;
do{
money -= 500000;
year++;
money+=money * 0.08;
}while(money >= 0);
printf("%d年之后,小甲鱼败光了所有的家产,再次回到一贫如洗……\n", year);
return 0;
}
yyiinn1
发表于 2023-1-15 11:48:24
1
麦阿风
发表于 2023-1-15 19:52:47
haihai