C语言上机150道题 下载本文

case 66:printf(\ case 67:printf(\ default:printf(\ } getch();} 38

#include #include main() {

int a,b,c,d,t;

printf(\请输入4个整数:a,b,c,d:\\n\ scanf(\ if(a>b) {

t=a; a=b; b=t; } if(c>d) {

t=d;

d=c; c=t; } if(a>c) {

t=c; c=a; a=t; } if(b>d) {

t=b; b=d; d=t; } if(b>c) {

t=b; b=c; c=t; }

printf(\排序后:%d<%d<%d<%d\

getch(); } 39

#include #include main() {

int s,p; float tax;

printf(\ scanf(\ printf(\ if(s>800) {

if((s-800)0!=0) p=(s-800)/100+1; else

p=(s-800)/100; switch(p) case 0:

case 1: case 2: case 3:

case 4:tax=(s-800)*0.05; break;

case 5:tax=400*0.05+(s-1200)*0.08; break;

default:tax=400*0.05+800*0.08+(s-2000)*0.2; break; } }

else tax=0;

printf(\ getch(); } 40

#include #include main() {

int score ,temp,logic; char grade;