#include#includeusing namespace std;main(){ int x=0,y=0;cout <<"please input a number for x."cin >>x;swich(x)case (x<10): y=x/4+x*5; breack;case (x=10): y=x*2+x*3+5; breack;case (x>10): y=2*x+(2*x)/2; breack; default:cout<<"it is wrong!";return 0;}//也许有点语法错误,呵呵参考就可以了。
#includemain(){int x,y;scanf("%d",&x);if(x<10)y=x/4+x*2;elseif(x==10)y=2*x+x*2/2;elsey=x2+3x+5;printf("%d",y);}