2019年1月26日

摘要: 思路:判断语句,小于0加符号,大于0直接输出 #include <stdio.h>#include <stdlib.h> int main(){ double a; while(scanf("%lf",&a)!=EOF) { if(a<0) a=-a; printf("%.2lf\n",a); } 阅读全文
posted @ 2019-01-26 10:33 zhs的小迷弟 阅读(404) 评论(0) 推荐(0) 编辑
摘要: 思路:用pow函数,定义pi #include <stdio.h>#include <stdlib.h>#include"math.h"#define PI 3.1415927 int main(){ double r,c; while(scanf("%lf",&r)!=EOF) { c=pow(r 阅读全文
posted @ 2019-01-26 10:32 zhs的小迷弟 阅读(2807) 评论(0) 推荐(0) 编辑
摘要: 思路:用pow函数计算,并且分开两步,比较简洁 #include <stdio.h>#include <stdlib.h>#include<math.h> int main(){ double x,y,m,n,c; while(scanf("%lf %lf %lf %lf",&x,&y,&m,&n) 阅读全文
posted @ 2019-01-26 10:30 zhs的小迷弟 阅读(167) 评论(1) 推荐(0) 编辑
摘要: 思路:abc大小有六种情况 分别比较 #include <stdio.h>#include <stdlib.h> int main(){ char a,b,c; while(scanf(" %c%c%c",&a,&b,&c)!= EOF) {if(a>=b) { if(a>=c&&c>=b) pri 阅读全文
posted @ 2019-01-26 10:28 zhs的小迷弟 阅读(299) 评论(0) 推荐(0) 编辑

导航