找考题网-背景图
未分类题

以下程序的输出结果是 #include<iostream.h> void reverse(int a [ ] ,int n) {int i,t; for(i=0;i<n/2;i++) {t=a[i];a[i]=a[n-1-i];a[n-1-i]=t;} } void main( ) {int b[10]={1,2,3,4,5,6,7,8,9,10}
A.22
B.10
C.34
D.30

A.h>
B.22
B.10
C.34

【参考答案】

A
解析:在main函数中,调用reverse函数将b数组中的前8个成员进行互置,执行完毕后,b数组中的成员为{8,7,6,5,4,3,2,1,9,10},在执行for循环结构后,将b[6],b[7]……b[9]的值相加,结果为 1+2+9+10=22。注意:在计算累加和时,应将累加变量赋值为零。
热门试题

未分类题You are the administrator of a Windows NT Server 4.0 computer named Ezonexam1. Ezonexam1 is a backup domain controller (BDC), and a member of Ezonexam.com's Windows 2000 Active Directory domain. Ezonexam1 contains five hard disks. Disk 0 and 1 are configured as a Windows NT 4.0 mirror set.The mirror set contains the operating system files and 500 MB of free disk spacE.Disk 2, 3 and 4 are configured as a Windows NT 4.0 stripe set with parity and contain employee data files. The Windows NT 4.0 stripe set with parity has a maximum capacity of 140 GB and contains 15 GB of free disk spacE.Ezonexam1 runs an application that is used by 400 company employees. A new version of the application is availablE.You need to install the new version, but it requires Windows 2000 Server. Also, the application will not run on a domain controller.You need to install the new application on Ezonexam1 as quickly as possiblE.What should you do first?A.On Ezonexam1, back up the employee data files. Then format all five disks and perform. a clean installation of Windows 2000 Server. Restore the employee data files.B.On Ezonexam1, install Windows 2000 Server. Configure Ezonexam1 to use a dual-boot configuration that includes Windows NT Server 4.0 and Windows 2000 Server.C.Upgrade Ezonexam1 to Windows 2000 Server. During the upgrade, select the option to make Ezonexam1 a member server.D.Upgrade Ezonexam1 to Windows 2000 Server. During the upgrade, select the option to make Ezonexam1 a domain controller. After the upgrade is complete, demote Ezonexam1.

A.0
B.com's
C.0
D.
The
E.0
F.0
G.
Ezonexam1
H.
You
I.On
J.
B.On
K.0
L.
C.Upgrade
M.
D.Upgrade