DT_Nelson
发表于 2019-7-20 19:25:55
#include <stdio.h>
int main(){
int count = 0;
double a, b;
a = b = 10000;
do{
a += 0.1*10000;
b *= 1.05;
count++;
}while(a>=b);
printf("After %d years,heiye will have more money than xiaojiayu.\n", count);
printf("xiaojiayu's money: %.2lf\n", a);
printf("heiye's money: %.2lf\n", b);
return 0;
}
DT_Nelson
发表于 2019-7-20 19:33:13
#include <stdio.h>
int main(){
int count = 0;
float money = 400;
do{
money -= 50;
money *= 1.08;
count++;
}while(money>0);
printf("After %d years,xiaojiayu becomes poor again!\n", count);
return 0;
}
DT_Nelson
发表于 2019-7-20 19:48:39
#include <stdio.h>
#include <math.h>
int main(){
double pi = 0, temp, i = 1.0;
do{
temp = (int)i%4==1?1/i:-1/i;
pi += temp;
i += 2;
}while(fabs(temp)>=pow(10, -8));
pi *= 4;
printf("%.7lf\n", pi);
return 0;
}
DT_Nelson
发表于 2019-7-20 19:55:23
#include <stdio.h>
int main(){
int a;
a = a = 1;
for(int i = 2; i<24; i++){
a = a + a;
}
printf("After 2 years,there'll be %d pairs of rabbits.\n", a);
return 0;
}
wyhgogogo
发表于 2019-7-21 08:38:05
1
lllhc11
发表于 2019-7-21 10:58:38
打卡打卡
lllhc11
发表于 2019-7-21 11:07:19
小甲鱼goto语句那里是不是搞错了呀,goto语句不是跳转到标签后就从标签开始顺序执行吗
#include <stdio.h>
int main(void)
{
int size;
int cost = 1, flag = 1, bill = 1;
scanf("%d", &size);
if (size > 12)
{
goto a;
printf("OOKK!\n");
}
printf("here!\n");
goto b;
a:cost = cost * 1.05;
flag = 2;
b:bill = cost * flag;
}
lllhc11
发表于 2019-7-21 11:08:05
lllhc11 发表于 2019-7-21 11:07
小甲鱼goto语句那里是不是搞错了呀,goto语句不是跳转到标签后就从标签开始顺序执行吗
#include
我输入13的话,他是什么都不打印欸
bro丶
发表于 2019-7-21 14:57:10
看看
jiajie8808
发表于 2019-7-22 10:49:03
加油
潇洒小小鸟
发表于 2019-7-22 11:05:49
1
q641565962
发表于 2019-7-22 14:28:51
看看
矮子-小甲鱼
发表于 2019-7-22 16:52:15
a
LIVESTRONG
发表于 2019-7-22 19:21:07
作者吱吱吱吱吱吱吱吱
快乐裤衩
发表于 2019-7-22 19:37:40
lgpmynpy
zhi.wang
发表于 2019-7-22 19:51:49
实测为
15518870632
发表于 2019-7-22 20:28:12
{:5_90:}
千晓夜
发表于 2019-7-23 17:17:41
答案
LIHAOJIEAQ
发表于 2019-7-24 21:54:47
0、90个
1、10个
2、a,b,c
3、a=14,b=4,c=10
4、x=-x?z:
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()
{
float i=10000,j=10000;
int count=0;
while(i<=j)
{
i=i*0.05+i;
j=10000*0.1+j;
count++;
}
printf("%d年后,黑夜的投资额超过小甲鱼!\n",count);
printf("小甲鱼的投资额是:%.2f\n",j);
printf("黑夜的投资额是:%.2f\n",i);
return 0;
}
1、#include<stdio.h>
int main()
{
float i=4000000;
int count=0;
while(i>0)
{
i=(i-500000)*1.08;
count++;
}
printf("%d年之后,黑小甲鱼败光了所有的家产,再次回到一贫如洗......\n",count);
return 0;
}
2、#include<stdio.h>
#include<math.h>
int main()
{
double Pi=2,i=1,j=1;
while(fabs(i)<pow(10,-8))
{
i=1/j;
i=-i;
Pi=Pi+i;
j=j+2;
}
printf("Pi的近似值为:%.7f",4*Pi);
return 0;
}
3、#include<stdio.h>
#include<math.h>
int main()
{
long long count=2;
count=pow(2,32);
printf("共有%llu对兔子\n",count);
return 0;
}
Jormungandr
发表于 2019-7-25 22:24:27
100,0,a,14