#include<stdio.h> int main() { int a,b,c,t; printf("请输入三个整数"); scanf("%d%d%d",&a,&b,&c); if(a<b){ t=a; a=b; b=t; } if(b>c) { printf("%d\t%d\t%d\n",a,b,c);} else if(c<a){ printf("%d\t%d\t%d\n",c,a,b); } else{ printf("%d\t%d\t%d\n",a,b,c); } return 0; }
# include <stdio.h> # include <math.h> int main(void) { double x, y; printf("输入 x:"); scanf("%lf", &x); if (x >4){ y = sqrt(x-4); } else if (x <-5){ y =fabs(x); } else{ y = x+3; } printf("结果= %.2f\n", y); return 0; }
#include<stdio.h> int main() { char ch; printf("请输入一个字符:\n"); scanf("%c",&ch); printf("其大写字符是:%c\n",ch-32); }
# include <math.h> int main(void) { double x, y; printf("输入 x:"); scanf("%lf", &x); if (x >=10){ y = (3*x)-11; } else if (x <1){ y =x; } else { y = (2*x)-11; } printf("结果= %.2f\n", y); return 0; }
# include <stdio.h> int main(){ int a; printf("请输入成绩;"); while(scanf("%d",&a) && a >= 0 && a <= 100) if(a>=90) {printf("A");} else if(a<=89&a>=80){ printf("B");} else if(a<=79&a>=70) {printf("C");} else if(a<=69&a>=60){ printf("D"); } else if(a<60){ printf("E"); } }
时间: 2024-10-10 17:29:48