写出程序的输出结果。 #include main() {ìntk=lO; char c="b"'; do swith
写出程序的输出结果。
#include
main()
{ìntk=lO; char c="b"';
do
swith(c++)
{ case'a':k++;
case'b':k--;
case'c' :k+=3;break;
case'd',:k=k%4;
}
while(c! ='c');
printf("%d\n",k );
}
运行结果是:____________
写出程序的输出结果。
#include
main()
{ìntk=lO; char c="b"';
do
swith(c++)
{ case'a':k++;
case'b':k--;
case'c' :k+=3;break;
case'd',:k=k%4;
}
while(c! ='c');
printf("%d\n",k );
}
运行结果是:____________
写出程序的运行结果。
#include
main()
{int a, b;
scanf ("%d%d", &a, &b);
if (a>=h) printf("Yes");
printf (" a+h =%d\n", a+h );
}
如果输入:a=6,b=8,则输出结果是___________
请写出如下程序的输出结果:
#include void Swap(int &a, int & b);void main(){int x(10 ), y(7 );
cout<< "x="<< x<< " y="<< y<< endl;Swap(x , y );cout<< "x="<< x<< " y="<< y<< endl;
}void Swap(int & a, int & b){ int temp; temp = a ; a=b ; b=temp ; }
阅读下面程序,写出输出结果。
#include using namespace std ; class A { int a, b; public : A() { a = b = 0; }
A(int aa, int bb) { a = aa; b = bb; cout << a << ' ' << b << endl ; } }; int main() { A x, y(2,3);
return 0; }
请写出如下程序的输出结果:
#include class R{public:R(int r1,int r2) {R1=r1;R2=r2;}void print();
void print() const;private:int R1,R2;};void R::print(){cout<< R1<< ":"<< R2<< endl;
}void R::print() const{cout<< R1<< ";"<< R2<< endl;}void main(){R a(5,4);a.print();
const R b(20,52);b.print();}
写出以下程序的运行结果。
#include int fun(int a){int b=0;static int c=3;b ; c ;return(a b c);}
main(){int i, a=5;for (i=0; i<3; i )cout<< i<< " "<< fun(a)<< " ";}
A.011
B.11
C.9
D.%d
以下程序的输出结果为()。 include<stdio.h> define PT 5.5 define S(x)PT*x*x void main() { int a=1,b=2; printf("%5.1f\n",S(a+b)); )
A.12.0
B.9.5
C.12.5
D.33.5
现有如下程序,则程序的输出结果为()。 include“stdio.h” int f(int a,int b) { int c; if(a>0&&a<10)c=(a+b)/2; else c=a*b/2; return c; } void main() { int a=8,b=20,c; c=f(a,b); printf(“%d\n”,c), }
A.随机数
B.80
C.28
D.14