标签:ali 计算 异常 循环 结果 double 包含 problem span
#include<stdio.h> #include<math.h> int main(void) { double n; while(~scanf("%lf",&n)) { if(n<0) n=-n; printf("%0.2lf\n",n); } return 0; }
2.计算球的体积
#include<stdio.h> #include<math.h> #define PI 3.1415927 int main(void) { double r; while(~scanf("%lf",&r)) { double V=0; V=4.0/3*PI*r*r*r; printf("%0.3lf\n",V); } return 0; }
3.成绩转换
#include<stdio.h> #include<math.h> int main(void) { int t; while(~scanf("%d",&t)) { if(t>=90&&t<=100) printf("A\n"); else if(t>=80&&t<=89) printf("B\n"); else if(t>=70&&t<=79) printf("C\n"); else if(t>=60&&t<=69) printf("D\n"); else if(t>=0&&t<=59) printf("E\n"); else printf("Score is error!\n"); } return 0; }
标签:ali 计算 异常 循环 结果 double 包含 problem span
原文地址:https://www.cnblogs.com/ping2yingshi/p/12241202.html