摘要: #include <stdio.h> int main(){ double number; int i; scanf( "%lf", &number ); if ( number > 1 && number == (int) number ){ for ( i = 2; i < number; i+ 阅读全文
posted @ 2020-07-20 11:15 Morninghui 阅读(473) 评论(0) 推荐(0)
摘要: 问题描述:一球从M米高度自由下落,每次落地后返回原高度的一半,再落下。 问:它在第N次落地时反弹多高?共经过多少米?保留两位小数。 解析:1、由题可知:每次反弹的高度是上一次的1/2,所以第N次反弹的高度是(1/2)^n。 2、经过的总路程=球下落的总路程+上升的总路程。 3、可用等比数列解决该问题 阅读全文
posted @ 2020-07-13 21:59 Morninghui 阅读(1577) 评论(0) 推荐(0)
摘要: 问题描述: 企业发放的奖金根据利润提成。 利润低于或等于100000元的,奖金可提10%;利润高于100000元,低于200000元(100000<I≤200000)时,低于100000元的部分按10%提成,高于100000元的部分,可提成 7.5%;200000<I≤400000时,低于20000 阅读全文
posted @ 2020-07-13 21:49 Morninghui 阅读(1396) 评论(0) 推荐(0)
摘要: #include <stdio.h> int main(int argc, char *argv[]) { int sum; scanf("%d/n",&sum); while(sum>100||sum<0){ printf("范围错误,重新输入"); scanf("%d",&sum); } swi 阅读全文
posted @ 2020-07-13 21:43 Morninghui 阅读(470) 评论(0) 推荐(0)
摘要: #include <stdio.h> int main(int argc, char *argv[]) { int x,y; scanf("%d",&x); if(x<1){ y=x; } else if(x>=1||x<10){ y=2*x-1; } if(x>10){ y=3*x-11; } p 阅读全文
posted @ 2020-07-12 20:40 Morninghui 阅读(2070) 评论(0) 推荐(0)
摘要: #include <stdio.h> int main(int argc, char *argv[]) { float c,F; scanf("%f",&c,&F); c=5*(F-32)/9; printf("c=%.2f",c); return 0;} 阅读全文
posted @ 2020-07-12 20:38 Morninghui 阅读(1050) 评论(0) 推荐(0)
摘要: #include <stdio.h> int main(int argc, char *argv[]) { char c1,c2,c3,c4,c5; scanf("%c",&c1); scanf("%c",&c2); scanf("%c",&c3); scanf("%c",&c4); scanf(" 阅读全文
posted @ 2020-07-12 20:36 Morninghui 阅读(967) 评论(0) 推荐(0)
摘要: #include <stdio.h> int main(int argc, char *argv[]) { int a,b,c,t; scanf("%d%d%d",&a,&b,&c,&t); if(a>b){ t=a; } else{ t=b; } if(c>t){ t=c; } printf("% 阅读全文
posted @ 2020-07-12 13:32 Morninghui 阅读(175) 评论(0) 推荐(0)