有如下程序:
#include <iostream>
using namespace std;
template <typename T>
T total( T *data)
T s=0;
while (*data)
s+=*data++;
return s;
int main ( )
int x[]=2,4,6, 8,0, 12, 14,16, 18 ;
cout<<total (x);
return 0;
执行上面程序的输出结果是 【13】 。
题库:计算机等级考试
类型:填空题
时间:2017-07-03 15:02:27
免费下载:《填空》Word试卷
有如下程序:
#include <iostream>
using namespace std;
template <typename T>
T total( T *data)
T s=0;
while (*data)
s+=*data++;
return s;
int main ( )
int x[]=2,4,6, 8,0, 12, 14,16, 18 ;
cout<<total (x);
return 0;
执行上面程序的输出结果是 【13】 。
本题关键词:程序,有序镜检,工程施工程序,复苏程序,工作程序,建设程序,程序变更,程序冲突,点火程序,生产程序;