单项选择题

以下程序的输出结果是 #include <iostream.h> void main() { int a=0,i; for(i=1 ;i<5;i++) { switch(i) { case 0: case 3: a+=2; case 1: case 2: a+=3; default: a+=5; } } cout<<a<<end1; return; }

A.31
B.13
C.10
D.20
<上一题 目录 下一题>
热门 试题

单项选择题
有以下程序: class Date { public: Date(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 = a.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 date 1 (2000,1,1),date2(0,0,0); Date date3(date 1); date2 = fun(date3); return 0; } 程序执行时,Date 类的拷贝构造函数被调用的次数是
A.2
B.3
C.4
D.5
填空题
在面向对象方法中,允许作用于某个对象上的操作称为 【2】 。
相关试题
  • 有如下程序:#include <iostream>using...
  • 有以下程序#include <iostream>using ...
  • 已知 int DBL(int n){return n+n;...
  • 在下面横线上填上适当的语句,完成程序。#...
  • 下列程序的输出结果是 【10】 。#incl...