请编写一个函数unsigned short fun(unsigned short s

题型:问答题

问题:

请编写一个函数unsigned short fun(unsigned short s)。其中s是一个大于10的无符号整数,若s是一个n(n≥2)位整数,函数求出s的n位数之和作为函数的返回值。 例如,s值为4315,则函数返回13。s值为13函数,则返回4。注意:部分源程序已存在文件PROC15.cpp中。 请勿修改主函数和其他函数中的任何内容,仅在函数fun()的花括号中填写若干语句。 文件PROC15.cpp的内容如下: //PROC15.cpp #include<iostream> using namespace std; unsigned short fun(unsigned short s); int main() { unsigned short a; cout<<"Enter a unsigned short integer number:"; cin>>a; if(a<10)cout<<"Data error!"; elsecout<<"The result: "<<fun(a)<<end1; return 0; } unsigned short fun(unsigned short s) { //* * * * * * }

考点:计算机等级考试C++二级C++机试12
题型:问答题

猩红热治疗应首选

A.病毒唑
B.青霉素
C.红霉素
D.链霉素
E.庆大霉素

题型:问答题

下列经营活动中,应按服务业税目缴纳营业税的是()。

A.装卸搬运劳务

B.机器维修服务

C.报刊发行业务

D.租赁业务服务

题型:问答题

受力钢筋的绑扎接头,不应集中在()内。

题型:问答题

高加事故疏水的投运及注意事项是什么?

题型:问答题

海洋资源是(),只能由国家所有而不能由某个人或某企业所拥有。

A、资源

B、水资源

C、公共资源

D、私人资源

更多题库