homework160809207刘兆轩
# include <stdio.h> int main() { float a,b,c,m,n,l,k,j,i; printf("请输入三个数:\n"); scanf("%f %f %f",&a,&b,&c); m = a > b ? a : c; n = b > c ? b : c; l = m > n ? m : n; k = a < b ? a : b; j = b < c ? b : c; i = k < j ? k : j; if (a > i && a < l) { printf("%f %f %f\n",l,a,i); } else if(b > i && b < l) { printf("%f %f %f",l,b,i); } else { printf("%f %f %f",l,c,i); } return 0; }
#include<stdio.h> #include<math.h> int main() { float x,y; printf("请输入x:\n"); scanf("%f",&x); { if(x>4) y=sqrt(x-4); if(x<-5) y=fabs(x); if(x>=-5&x<=4) y=x+3; printf("%f",y); } return 0; }
#include"stdio.h" int main() { char ch; printf("请输入一个字符:\n"); scanf("%c",&ch); printf("其大写字符是:%c\n",ch-32); }
#include<stdio.h> #include<math.h> int main() { float x,y; printf("ÇëÊäÈëx:\n"); scanf("%f",&x); { if(x<1) y=(x); if(x>=1&x<=10) y=(2*x-1); if(x>10) y=(3*x-11); printf("%f",y); } return 0; }
#include<stdio.h> int main() { int a; printf("请输入成绩:"); scanf("%d",&a); if(a>100||a<0) { printf("????"); } else { a=a/10; switch(a) { case 10:printf("A\n");break; case 9: printf("A\n");break; case 8: printf("B\n");break; case 7: printf("C\n");break; case 6: printf("D\n");break; default:printf("E\n");break; } } return 0; } #include<stdio.h> int main() { int n; printf("请输入成绩:"); scanf("%d",&n); if(n>90) { printf("A"); } else if(n>=80 && n<=90) { printf("B"); } else if(n>=70 && n<=79) { printf("C"); } else if(n>=60 && n<=69) { printf("D"); } else { printf("E"); } return 0; }
posted on 2016-09-25 19:28 160809207刘兆轩 阅读(120) 评论(1) 编辑 收藏 举报