1
0.
100
1.
10
2.
a,b,c
3.
b=5 c=9 a=14
4.
z=(x>0?x:(-x))
5.
if (size > 12)
{cost = cost * 1.05;}
bill = cost * flag;
B.
if (ibex > 14)
{
sheds = 3;
}
sheds = 2;
help = 2 * sheds;
C.
readin: scanf("%d", &score);
if (score < 0)
{
printf("count = %d\n", count);
}
count++;
readin: scanf("%d", &score);
0.
#include<stdio.h>
#include<iostream>
using namespace std;
int main()
{
int n,m1=10000,m0=10000;
for(n=0;m1>=m0;n++)
{
m1+=10000*0.1;
m0*=1.05;
}
cout<<n<<'\n'<<m1<<'\n'<<m0;
return 0;
}
1.
#include<stdio.h>
#include<iostream>
using namespace std;
int main()
{
int n,a=4000000;
for(n=0;a>=500000;n++)
{
a=(a-500000)*1.08;
}
cout<<n;
return 0;
}
2.
#include<stdio.h>
int main()
{
double PI=0.0,n,k=1;
for(n=1;1/n>0.00000001;n+=2)
{
PI=PI+k*(1/n);
k=-k;
}
printf("PI=%.7f",4*PI);
return 0;
}
3.
找不出函数关系式
6
嘿,亲爱的鱼油,每天都要过得开心哦^_
学习打卡
10A
不会打印b
14 5 9
if (size > 12)
{
cost = cost * 1.05;
}
bill = cost * flag;
if (ibex > 14)
{
sheds = 3;
}
else
sheds = 2;
help = 2 * sheds;
readin: scanf("%d", &score);
if (score < 0)
{
printf("count = %d\n", count);
}
else
count++;
#include <stdio.h>
int main(){
float a =10000, b =10000;
int y=0;
while(!(a<b))
{
a=a+ 1000;
b=b+b*0.05;
y+=1;
}
printf("%d年后将超过\n",y);
printf("a的投资额是%.2f\n",a);
printf("b的投资额是%.2f\n",b);
return 0;
int main()
{
int a=4000000,b=500000,y=0;
while (a>0)
{
a = a -b;
a = a*1.08;
y =y+1;
}
printf("%d将花完",y);
return 0;
}
#include <math.h>
#include <stdio.h>
int main()
{
double pi,sum=0,i=1;
int count =1;
while(fabs(i)<1000000000)
{
if(count%2==1){
i +=2;
i = -i;
count+=1;
sum=sum+(1/i);}
else{
i=fabs(i)+2;
count+=1;
sum=sum+(1/i);
}
}
pi =(1+sum)*4;
printf("pi=%.7f\n",pi);
return 0;
}
111
1
111
#include <stdio.h>
#include <stdbool.h>
#include <math.h>
#pragma warning(disable:4996)//使用scanf语句
int main()
{
float i=10000, j=10000,y=0;
int x;
for (x = 0; j <= i; x++)
{
y = 0.1 * 10000;
i = y + i;
j = 0.05*j + j;
}
printf("%d年后黑夜投资额超过小甲鱼\n", x);
printf("小甲鱼的投资额为%.2f\n",i);
printf("黑夜的投资额为%.2f\n", j);
return 0;
}
#include <stdio.h>
#include <stdbool.h>
#include <math.h>
#pragma warning(disable:4996)//使用scanf语句
int main()
{
int x = 4000000,y;
for (y = 0; x > 0; y++)
{
x = x - 500000;
x = x * 0.08 + x;
}
printf("%d",y);
return 0;
}
#include <stdio.h>
#include <stdbool.h>
#include <math.h>
#pragma warning(disable:4996)//使用scanf语句
int main()
{
int i, j=0, k=1;
for (i = 0; fabs(1/k) < 10 ^ (-8); i++)
{
k = fabs(k) + 2;
if (i % 2 == 0)
{
k = -k;
}
j = 1 + (1 / k);
}
printf("%d",j);
return 0;
}
参考答案
加油
.
0.0
本帖最后由 SeeNoEvil 于 2021-12-9 17:21 编辑
0. 10个
1. 0个
2. a b c
3. a = 14;b = 5;c = 9
4. z = x >= 0 ?x : -x
5. if (size > 12)
{
cost = cost * 1.05;
flag = 2;
}
bill = cost * flag;
if (ibex > 14)
{
sheds = 3;
}
else
sheds = 2;
help = 2 * sheds;
scanf("%d", &score);
while(score >= 0){
scanf("%d", &score);
count++;
}
sprintf("count = %d\n", count);
{:5_108:}
100
10
a=33 b=4 c=10
if (size > 12)
{
cost = cost * 1.05;
}
else
bill = cost * flag;
if (ibex > 14)
{
sheds = 3;
}
else
sheds = 2;
help = 2 * sheds;
while(1)
{ scanf("%d",&score);
switch(score)
{
case (score < 0); printf("count = %d\n", count);
break;
}
}
嘿,亲爱的鱼油,每天都要过得开心哦^_^
.
答案