单项选择题

有如下程序
#include<iostream.h>
void main()
(char ch[2][5]="6937","8254"),*p[2];
int i,j,s=0;
for(i=0;i<2;i++)p[i]=ch[i];
for(i=0;i<2;i++)
for(j=0;p[i][j]>’\0’;j+=2)
s=10 * s+p[i][j]-’0;;
cout<<S;
该程序的输出结果是( )。

A.69825
B.63825
C.6385
D.693825
<上一题 目录 下一题>
热门 试题

单项选择题
下列函数的运行结果是( )。 #include<iostream.h> int f(int a,int b) int c; if(a>b)c=1; else if(a==b)c=0; else c=-1; return(c); void main() int i=2,j=3; int p=f(i,j); cout<<p;
A.-1
B.1
C.2
D.编译出错,无法运行
单项选择题
有以下程序: class Date public: Dare(int y,int m,int d); year=y; month=m; day=d; Date(int y=2000) year=y; month=10; day=1; Date(Date &d) year=d.year; month=d.month; day=d.day; void print() cout<<year(< . <<month<< . <<day<<end1; private: int year,month,day; ; Date fun(Date d) Date temp; temp=d; return temp; int main() Date date1(2000,1,1),date2(0,0,0); Date date3(date1); date2=fun(date3); return 0; 程序执行时,Date类的拷贝构造函数被调用的次数是( )。
A.2
B.3
C.4
D.5
相关试题
  • 表达式“c3=c1.operator+(c2)”或...
  • 程序中有如下语句: for(int i=0;i<...
  • 下列程序在构造函数和析构函数中申请和释放...
  • 用以下语句调用库函数malloc,使字符指针st...
  • 有如下定义: class MA int value; p...