【单选题】【消耗次数:1】
设有函数模板template Q Sum(Q x,Q y) {return (x)+(y);} 则下列语句中对该函数模板错误的使用是()
Sum(10,2);
Sum(0,7);
Sum(2f,0f);
Sum(“AB”,”CD”);
参考答案:
复制
纠错
相关题目
【单选题】 设有函数模板templateQ Sum(Q x,Q y) {return (x)+(y);} 则下列语句中对该函数模板错误的使用是()
①  Sum(10,2);
②  Sum(0,7);
③  Sum(2f,0f);
④  Sum(“AB”,”CD”);
【单选题】 设有函数T Sum(T x,T y){return x+y;},其中T为模板类型,则下列语句中对该函数错误的使用是( )
①  Sum(1,2);
②  Sum(0,2);
③  Sum(‘A’,‘C’);
④  Sum(A,C);
【单选题】 设有函数T Sum(T x,T y){return x+y;},其中T为模板类型,则下列语句中对该函数错误的使用是( )
①  Sum(1,2);
②  Sum(0,2);
③  Sum(‘A’,‘C’);
④  Sum(A,C);
【单选题】 下列语句中,将函数int sum(int x, int y)正确重载的是( )。
①  float sum(int x, int y);
②  int sum(int a, int b);
③  float sum(float x, float y);
④  double sum(int y, int x);
【单选题】 下列语句中,将函数int sum(int x, int y)正确重载的是( )。
①  float sum(int x, int y);
②  int sum(int a, int b);
③  float sum(float x, float y);
④  double sum(int y, int x);
【单选题】 在JavaScript中,运行下面的代码,sum的值是( )。 var sum = 0; for(i = 1; i < 10; i++) { if(i%5==0) break; sum = sum + i; }
①  40
②  50
③  5
④  10
【单选题】 在JavaScript中,运行下面的代码,sum的值是( )。var sum = 0;for(i = 1; i ( 10; i++) { if(i%5==0) break; sum = sum + i;}(选择一项)
①  40
②  50
③  5
④  10
【单选题】 以下程序段运行后sum的值为()。intk=0,sum=0;inta[3][4]={1,2,3,4,5,6,7,8,9,10,11,12};for(;kk++)sum+=a[k][k+1];
①  9
②  18
③  19
④  21
【单选题】 若以下变量均是整型,且num=sum=7,则执行表达式sum=num++,sum++,++num后sum的值为( )。
①  7
②  8
③  9
④  10
【单选题】 有以下程序,程序执行后的输出结果是( ) #include int fun(int x [ ],int n) { static int sum=0,i; for(i=0; i{ sum+=x[i]; } return sum; } void main( ) { int a[ ]={1,2,3,4,5}; int b[ ]={6,7,8,9},s=0; s=fun(a,5)+fun(b,4); printf(%d\n,s); }
①  45
②  50
③  60
④  66
随机题目
【单选题】 Hehasspentallhislifeworkingwithmentally______people.
①  disabled
②  discussed
③  naked
④  abolished
【单选题】 Doctors have said that as many as 50% of patients dont take medicine ______.
①  like directed
②  to be directed
③  as directed
④  so that directed
【单选题】 After filling out this form, please dont forget to______ your name.
①  sign
②  sigh
③  scribble
④  jot
【单选题】 —Why didnt you come to join her party?—I______, but I had to deal with something urgent.
①  would have
②  should
③  would do
④  was going to have
【单选题】 They couldn’t ______ to fly out to see us, and we couldnt either. We were all poor then.
①  offer
②  afford
③  provide
④  supply
【单选题】 Youve got a divorce? Why did he decide to______ you after seven years together?
①  keep company with
②  part company with
③  keep in touch with
④  stay in touch with
【单选题】 —How many poor counties will there be in our province by 2020?—There will be only a few, if _______.
①  much
②  some
③  any
④  many
【单选题】 Henry was very busy yesterday.Otherwise he______ to our my birthday party.
①  would have come
②  came
③  had come
④  will come
【单选题】 Our parents were strict. They requested that we______ television on week nights.
①  have not watched
②  not be watching
③  must not to watch
④  not watch
【单选题】 ---Why didn’t John call me ? ---Oh, his cell-phone ran out of power, otherwise he______ you.
①  had called
②  would have called
③  called
④  would call