题目内容

若运行时输入:4.4<回车>,则以下程序的运行结果是 。#include int main( ){ float costprice,sellingprice;printf("Enter Cost Price $:");scanf("%f",&costprice);if(costprice>=5){ sellingprice=costprice+costprice*0.25;printf("Selling Price(0.25)$%6.2f",sellingprice);}else{ sellingprice=costprice+costprice*0.30;printf("Selling Price(0.30)$%6.2f",sellingprice);}return 0;}

查看答案
更多问题

请阅读以下程序,若运行时输入:1605<回车>时,程序的运行结果是 。#include int main(){ int t,h,m;scanf("%d",&t);h=t/100%12;if(h==0) h=12;printf("%d:",h);m=t%100;if(m<10) printf("0");printf("%d",m);if (t<1200||t==2400)printf("AM");elseprintf("PM");return 0;}

若运行时输入:5999,则以下程序的运行结果是 。#include int main(){ int x;float y;scanf("%d",&x);if(x>=0&&xx<=2999) y=18+0.12*x;if(x>=3000&&x<=5999) y=36+0.6*x;if(x>=6000&&x<=10000)y=54+0.3*x;printf("%6.1f",y);return 0;}

以下程序的运行结果是 。#includeint main(){ int a,b,c,d,x;a=c=0;b=1;d=20;if(a) d=d-10;else if(!b)if(!c) x=15;else x=25;printf("%d\n",d);return 0;}

以下程序的运行结果是 。#includeint main(){ int x,y=-2,z=0;if((z=y)<0) x=4;else if(y==0) x=5;else x=6;printf("\t%d\t%d\n",x,z);if(z=(y==0))x=5;x=4;printf("\t%d\t%d\n",x,z);if(x=z=y) x=4;printf("\t%d\t%d\n",x,z);return 0;}

答案查题题库