以下程序的运行结果是 。#includeint main(){ int a1,a2,b1,b2;int i=5,j=7,k=0;a1=!k;a2=i!=j;printf("a1=%d\ta2=%d\n",a1,a2);b1=k&&j;b2=k||j;printf("b1=%d\tb2=%d\n",b1,b2);return 0;}
查看答案
若运行时输入:2<回车>,则以下程序的运行结果是 。#include int main( ){ char class;printf("Enter 1 for 1st class post or 2 for 2nd post");scanf("%c",&class);if (class=='1')printf("1st class postage is 19p");elseprintf("2nd class postage is 14p");return 0;}
若运行时输入: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;}