[单选题]

有以下程序:includeusing namespace std;int a;int fun();int main(){externint a;in

有以下程序: #include<iostream> using namespace std; int a; int fun(); int main() { externint a; int b; a=10; b=fun(); cout<<b<<end1; return 0; } int fun() { extern int a; return(10*a); } 其程序运行后的输出结果是( )。

A.10

B.1

C.100

D.1000

参考答案与解析:

相关试题

有以下程序:#includeusing namespace std;int ma

[单选题]有以下程序:includeusing namespace std;int main(){ int a=5,b=4,c=3,d=2; if(a>b>c有以下程序: #include<iostream> using namespace std; int main() { int a=5, b=4, c=3,d=2; if(a>b>c) cout<<d<<end1; else if((c-1>=D) ==1) cout<<d+1<<end1; else cout<<d+2<<end1; return

  • 查看答案
  • 有以下程序:#includeusing namespace std;int ma

    [单选题]有以下程序:includeusing namespace std;int main(){int x=15;while(x>10&&x有以下程序: #include<iostream> using namespace std; int main() { int x=15; while(x>10&&x<50) { x++; if(x/3) { x++;break; } } cout<<x<<endl; return 0; } 执行后的输出结果是( )。A.15B.16

  • 查看答案
  • 有以下程序:#includeusing namespace std;int ma

    [单选题]有以下程序:includeusing namespace std;int main(){ intx=15; while(x>10&&有以下程序: #include <iostream> using namespace std; int main() { int x=15; while(x>10&&x<50) { x++; if(x/3) { x++; break; } } cout<<x<<end1; return 0; }A.15B.16C.17D.18

  • 查看答案
  • 有以下程序#includeusing namespace std;int a;i

    [单选题]有以下程序includeusing namespace std;int a;int fun();int main(){extern int a;in有以下程序 #include<iostream> using namespace std; int a; int fun(); int main() { extern int a; int b; a=100; b=fun(); cout<<b<<endl; return 0; } int fun() { extern int a; return(10

  • 查看答案
  • 有以下程序:#includeusing namespace std;int f(

    [单选题]有以下程序:includeusing namespace std;int f(int x);int sum(int n){ int x,s=0; f有以下程序: #include<iostream> using namespace std; int f(int x); int sum(int n) { int x,s=0; for(x = 0;x<=n;x++) s+=f(x); return s; } int f(int x) { return (x*x+1); } int main() {

  • 查看答案
  • 有以下程序:#includeusing namespace Std;int ma

    [单选题]有以下程序:includeusing namespace Std;int main(){ int a = 15,b = 21,m = 0; swit有以下程序: #include <iostream> using namespace Std; int main( ) { int a = 15,b = 21,m = 0; switch(a%3) { case 0: m++; break; case 1: m++; switch(b%2) {A.1B.2C.3D.4

  • 查看答案
  • 若有以下程序:#includeusing namespace std;int m

    [单选题]若有以下程序:includeusing namespace std;int main(){ int a=3; cout<<(a£«=a£­=a£«A)若有以下程序: #include <iostream> using namespace std; int main() { int a=3; cout<<(a+=a-=a+A) <<end1; return 0; } 程序执行后的输出结果是( )。A.-6B.12C.0D.-12

  • 查看答案
  • 若有以下程序:#includeusing namespace std;int f

    [单选题]若有以下程序: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; re

  • 查看答案
  • 若有以下程序段;#includeusing namespace std;int

    [单选题]若有以下程序段;includeusing namespace std;int main(){ int a[]={1,4,5}; int *p=&若有以下程序段; #include<iostream> using namespace std; int main() { int a[]={1,4,5}; int *p=&a[0],x=6,y,z; for(y=0;y<3;y++) z=((*(p+y)<x) ? *(p+y):x); cout<<z<<end1; return 0; } 程序

  • 查看答案
  • 有下列程序:#includeusing namespace std;int ma

    [单选题]有下列程序:includeusing namespace std;int main(){void function(double val);doub有下列程序: #include<iostream> using namespace std; int main() { void function(double val); double val; function(val); cout<<val; return 0; } void fimction(double val) { vA.编译出错,无法运

  • 查看答案
  • 有以下程序:#includeusing namespace std;int a;