网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
若有以下程序: include using namespace std;int f(){static int i = 0;ints= 1;s+=i
若有以下程序: #include <iostream> using namespace std; int f() { static int i = 0; ints= 1; s+=i; i++; return s; } int main() { int i,a = 0; for(i = 0;i<5;i++) a+=f(); cout<<a<<endl; return 0; } 程序运行后,输出的结果是
A.20
B.24
C.25
D.15
参考答案
更多 “ 若有以下程序: include using namespace std;int f(){static int i = 0;ints= 1;s+=i 若有以下程序: #include <iostream> using namespace std; int f() { static int i = 0; ints= 1; s+=i; i++; return s; } int main() { int i,a = 0; for(i = 0;i<5;i++) a+=f(); cout<<a<<endl; return 0; } 程序运行后,输出的结果是A.20B.24C.25D.15 ” 相关考题
考题
下面程序的运行结果是【】。 include using namespace std; class count{ static int n;
下面程序的运行结果是【 】。include <iostream>using namespace std;class count{static int n;public:count(){n++;}static int test(){for(int i=0;i<4;i++)n++;return n;}};int count::n = O;int main(){cout<<count:: test()<<" ";count c1, c2;cout<<count:: test()<<endl;return 0;}
考题
以下程序的输出结果是 include int f( ) { static int i=0; int s=1 s+ =i;
以下程序的输出结果是 #include<iostream.h> int f( ) { static int i=0; int s=1 s+ =i; i++; return s;} void main( ) { int i,a=0; for(i=0 ;i<5;i++)a+=f( ); cout < < a;}A.20B.24C.25D.15
考题
若有如下程序:include using namespaces std;int s=0;class sample{static int n;pub
若有如下程序:#include <iostream>using namespaces std;int s=0;class sample{static int n;public:sample(int i){ n=i;}static void add(){ s+=n;}};int sample:: n=0;int main(){sample a(2),b(5);sample:: add();cout<<s<<end1;return 0;}程序运行后的输出结果是( )。A.2B.5C.7D.3
考题
有以下程序: include using namespace std; int f(int); int main() {int i;for(i=0;
有以下程序:include <iostream>using namespace std;int f(int);int main(){int i;for(i=0;i<5;i++)cout<<f(i)<<" ";return 0;}int f(int i){static int k=1;for(;i>0;i--)k+=i;
考题
有以下程序: include using namespace std; int main() {int i=010,j=10;cout
有以下程序:include <iostream>using namespace std;int main(){int i=010,j=10;cout<<(++i)<<","<<i--<<end1;return 0;}则该程序运行后的输出结果是【 】。
考题
以下程序的输出结果是【】。 include using namespace std; int main(){ int sum,i; for(
以下程序的输出结果是【 】。include<iostream>using namespace std;int main(){int sum,i;for(sum=0,i=1;i<5;i++)sum+=i;cout<<sum<<endl;return 0;}
考题
以下程序的输出结果是【】。 include using namespace std; int main() {int s,i;for(s=
以下程序的输出结果是【 】。include <iostream>using namespace std;int main(){int s,i;for(s=0,i=1;i<3;i++)s+=i;cout<<s<<end1;return 0;}
考题
有如下程序:include using namespace std;int getSum(int num);int main (){ int i;
有如下程序: #include <iostream> using namespace std; int getSum(int num); int main () { int i; for (i=1; i<4; i++) cout<<getSum(i); return 0; } int getSum(int hum) { static int sum=O; sum+=num; return sum; } 上述程序执行后的输出结果是( )。A.136B.248C.123D.135
考题
若有以下程序:include using namespace std;int f(){static int i = O;ints= 1;s+=i;
若有以下程序:#include <iostream>using namespace std;int f(){ static int i = O; ints= 1; s+=i; i++; return s;}int main(){ int i, a =0; for(i=0;i<5;i++) a+=f(); cout<<a<<end1; return 0;}程序运行后,输出的结果是( )。A.20B.24C.25D.15
考题
以下程序的输出结果是 ( )。 include using namespace std; int f(int b[],int m, in
以下程序的输出结果是 ( )。 #include <iostream> using namespace std; int f(int b[],int m, int n) { int i,s = O; for(i = m;i<n;i+=2) s+=b [i]; return s; } int main ( ) { int x a[] = {1,2,3,4,5,6,7,8,9}; x = f(a,3,7); cout<<x<<end1; return 0; }A.10B.18C.8D.15
考题
若有以下程序:include using namespace std;int f(){static int i = 0;int s = 1;s+=
若有以下程序: #include <iostream> using namespace std; int f() { static int i = 0; int s = 1; s+=i; i++; return s; } int main() { int i,a = 0; for(i = 0;i<5;i++) a+=f(); cout<<a<<endl; return 0; } 程序运行后,输出的结果是A.20B.24C.25D.15
考题
若有以下程序:include using namespace std;int main(){ int a[4] [4] = {{1,2,3,-4}
若有以下程序: #include <iostream> using namespace std; int main() { int a[4] [4] = {{1,2,3,-4},{0,-12,-13,14}, {-21,23,0,-24},{-31,32,-33,0}}; int i,j,s = 0; for(i=0;i<4;i++) { for(j=O;j<4;j++) { if(a[i] [j] >=0) continue; s+=a [i] [j]; } } cout<<s<<end1; return 0; } 执行后的输出结果是( )。A.-138B.141C.75D.-1
考题
若有以下程序:includeusing namespace std;int f(){ static int i=O; int s=1; s+=i;
若有以下程序: #include<iostream> using namespace std; int f() { static int i=O; int s=1; s+=i; i++; return s; } int main() { int i,a=0; for(i=0;i<5;i++) a+=f(); cout<<a<<endl; retrun 0; } 程序运行后,输出的结果是A.20B.24C.25D.15
考题
假定有如下程序:include using namespace std;int s =0;class example{ static int n
假定有如下程序: #include <iostream> using namespace std; int s =0; class example{ static int n; public: example(int i){ n=i; } static void add( ){ s+=n; } }; int example::n=0; int main( ){ example a(2),b(5); example::add(); cout<<s<<endl; return 0; }程序运行后输出结果为( )。A.2B.3C.7D.5
考题
若有如下程序:includeusing namespace std;int s=O;class sample{static int n;publi
若有如下程序: #include<iostream> using namespace std; int s=O; class sample { static int n; public: sample(int i) { n=i; } static void add() { s+=n; } }; int sample::s=0; int main() { sample a(2),b(5); sample::add(); cout<<S<<end1; return 0; } 程序运行后的输出结果是A.2B.5C.7D.3
考题
有以下程序: include using namespace std; int main() {int x;for(int i=1;i
有以下程序: #include <iostream> using namespace std; int main() { int x; for(int i=1;i<=100;i++) { x=i; if (++x%2==0) if (++x%3==0) if (++x%7==0) cout<A.39,81B.42,84C.26,68D.28,70
考题
有以下程序:include using namespace std;int s=0;class sample{ static int n;publi
有以下程序: #include <iostream> using namespace std; int s=0; class sample { static int n; public: sample (int i) { n=i; } static void add() { s+=n; } }; int sample::n=0;A.2B.5C.7D.3
考题
以下程序的输出是【】。 include using namespace std; fun(intm) { static int n=1; n=m
以下程序的输出是【 】。include<iostream>using namespace std;fun(intm){static int n=1;n=m*n;return(n);}void main(){int i;for(i=1;i<=3;i++) cout<<fun(i);}
考题
有如下程序:include using namespace std;int s=0;class sample { static int n;publ
有如下程序: #include <iostream> using namespace std; int s=0; class sample { static int n; public: sample(int i) { n=i; } static void add() { s+=n; } };A.2B.5C.7D.3
考题
若有以下程序:include using namespace std;class myClass{private: int var;public:
若有以下程序: #include <iostream> using namespace std; class myClass { private: int var; public: myClass(int i) { var=i; } void add() { s+=var; } static int s; void display() { cout<<s<<end1; } }; int myClass::s=0; int main ( ) { myClass a(1),b(2),c(3); a.add(); b.add(); c.dislay(); return O; } 程序执行后的输出结果是( )。A.1B.4C.3D.7
考题
有以下程序: include using namespace std; int main() {int i=1,sum=0;Loop:if(i
有以下程序:include<iostream>using namespace std;int main(){int i=1,sum=0;Loop:if(i<=20){sum+=i;i++;goto Loop;}cout<<sum<<end1;return 0;}该程序运行后的输出结果是【 】。
考题
有如下程序:includeusing namespace std;int s=0;class sample{ static int n;public
有如下程序: #include<iostream> using namespace std; int s=0; class sample { static int n; public: sample(int i) { n=i; } static void add() { s+=n; } }; int sample::s=0; int main() { sample a(2),b(5); sample::add(); cout<<s<<endl; return 0; } 程序运行后的输出结果是A.2B.5C.7D.3
考题
若有以下程序:includeusing namespace std;int fun(){static int i=0;int s=1;s+=i;i
若有以下程序: #include<iostream> using namespace std; int fun() { static int i=0; int s=1; s+=i; i++; return s; } int main() { int i,a=0; for(i=0;i<5;i++) a+=fun(); cout<<a<<endl; return 0; } 程序运行后,输出的结果是( )。A.20B.24C.26D.15
考题
若有如下程序:includeusing namespace std;int s=0;class sample{static int n;pubic
若有如下程序: #include<iostream> using namespace std; int s=0; class sample { static int n; pubic: sample(int i) { n=i; } static void add() { S+=n; } }; int sample::n=O; int main() { sample a(2),b(5); sample::add(); cout<<s<<endl; return 0; } 程序运行后的输出结果是( )。A.2B.5C.7D.3
考题
若有如下程序:includeusing namespace std;int s=0;class sample{static int n;publi
若有如下程序: #include<iostream> using namespace std; int s=0; class sample { static int n; public: sample(int i) { n=i; } static void add() { S+=n; } }; int sample::n=0; int main() { sample a(2),b(5); sample::add(); cout<<s<<endl; return 0; } 程序运行后的输出结果是( )。A.2B.5C.7D.3
考题
若有如下程序:include using namespaces std;int s=0;class sample {static iht n;pu
若有如下程序: #include <iostream> using namespaces std; int s=0; class sample { static iht n; public: sample(int i) { n=i; } static void add() { s+=n; } }; int sample::s=0; int main() { sample a(2),b(5); sample::add(); cout<<s<<endl; return 0; } 程序运行后的输出结果是A.2B.5C.7D.3
考题
若有如下程序: include using namespaee std; int fun() { static int i=0; int s=1;
若有如下程序: #include<iostream> using namespaee std; int fun() { static int i=0; int s=1; s+=i; i++; return s; } int main() { int i,a=0; for(i=0;i<5;i++) a+=fun(); cout<<a<<end1; return 0; } 程序运行后,输出的结果是( )。A.20B.24C.25D.15
热门标签
最新试卷