阅读下面程序: include int fun2(int m) { if(m%3==0) return 1; else return 0; } 阅读下面程序:include <iostream.h>int fun2(int m){if(m%3==0)return 1;elsereturn 0;}void fun1(int m, int s){int i;for (i=1; i<m; i++)if(fun2(i))S=S*i;}void main(){int n=9, s=2;fun1(n, s);cout<<s<<end1;}该程序的运行结果是【 】。

阅读下面程序: include int fun2(int m) { if(m%3==0) return 1; else return 0; }

阅读下面程序:

include <iostream.h>

int fun2(int m)

{

if(m%3==0)

return 1;

else

return 0;

}

void fun1(int m, int &s)

{

int i;

for (i=1; i<m; i++)

if(fun2(i))

S=S*i;

}

void main()

{

int n=9, s=2;

fun1(n, s);

cout<<s<<end1;

}

该程序的运行结果是【 】。


相关考题:

阅读下面程序:include long fib(int n){if (n>2)return (fib(n-1) + fib(n-2));else 阅读下面程序:include <iostream.h>long fib(int n){if (n>2)return (fib(n-1) + fib(n-2));elsereturn (2);}void main(){cout<<fib(3)<<end1;}则该程序的输出结果应该是【 】。

如下程序的输出结果是______。 include using namespace std; int funl(int x){retu 如下程序的输出结果是______。include<iostream>using namespace std;int funl(int x){return++x;}int fun2(int&x){return++x;}int main( ){int x:1,y=2;Y=funl(fun2(x));cout<<x<<','<<y;return 0;}

下面程序的结果【】。 include int f(int); void main() { int x=1,i; for (i=0; i 下面程序的结果【 】。include<iostream.h>int f(int);void main() {int x=1, i;for (i=0; i<3; i++)cout<<f(x)<<‘ ’ ;cout<<end1;}int f(int x){int y=1;static int z=3y++;z++;return (x+y+z);}

下列程序的输出结果是【】 include using namespace std; int get Var(int*pint) { 下列程序的输出结果是【 】include<iostream>using namespace std;int get Var(int*pint){return *pint;}int main(){int a=10;getvar(A) =20;cout<<a<<end1;return 0;}

4、阅读以下程序,填写运行结果_________________. def f(m): if m%2==1: return 1 else: return 0 if f(9)==1: print(True) else: print(False)

下面代码能通过编译的是:A.int main() { int a[3]={1,2,3}; int *b[3]={a[1],a[2],a[3]}; int **p = b; return 0; }B.int main() { int a[3]={1,2,3}; int *b[3]={a[1],a[2],a[3]}; int **p = b; return 0; }C.int main() { int a[3]={1,2,3}; int *b[3]={a[1],a[2],a[3]}; int *p = b; return 0; }D.int main() { int a[3]={1,2,3}; int *b[3]={a[1],a[2],a[3]}; int *p = b; return 0; }

写出下面程序执行后的运行结果。 #include <stdio.h> #include <math.h> #define ROUND(x,m) ((int)((x)*pow(10,m)+0.5)/pow(10,m)) int main() { printf("%f,%f", ROUND(12.3456,1),ROUND(12.3456,2)); return 0; }

阅读以下程序,填写运行结果_________________. def f(m): if m%2==1: return 1 else: return 0 if f(9)==1: print(True) else: print(False)

调试下列程序,写出输出结果,并解释输出结果 #include <iostream> using namespace std; int main() { void fun(int, int); int a, b; fun(2, a); fun(3, b); cout << "a + b = " << a + b << endl; return 0; } void fun(int m, int n) { n = m + 4; }