在下面程序的横线处填上______,使程序执行后的输出结果为1/2005。
include<iostream.h>
using namespace std;
class Date
{
Public:
D.ate(int m=1,int y=0): month(m),year(y){}
void Print(){cout<<month<<"/"<<year<<end1;}
______operator+(const Date&d1,const Date&d2);
private:
int month, year;
};
D.ate operator+(const Date&d1,const Date&d2)
{
int year,month;
year=d1.year+d2.year;
month=d1.month+d2.month;
year+=(month-1)/12;
month=(month-1)%12+1;
return Date(month,year);
}
void main()
{
D.ate d1(3,2004),d2,d3(10);
d2=d3+d1;
d2.Print();
}
[试题]在下面程序的横线处填上适当的语句,使程序执行后的输出结果为ABCD。 include using nam在下面程序的横线处填上适当的语句,使程序执行后的输出结果为ABCD。include<iostream>using namespace std;classA{public:A.(){cout<<'A';}};class B:______{public:B.(){cout<<'B';}};class C:______{public:C(){cout<<'C';}};class D:pub
[单选题]在下列程序的横线处填上适当的内容,使程序执行后的输出结果为ABCD。includeusing name在下列程序的横线处填上适当的内容,使程序执行后的输出结果为ABCD。 #include<iostream> using namespace std; class A { public:A(){cout<<‘A’;} }; Class B: { public:B(){cout<<‘B’;} }; class C:virtual public A { public:C(){cout<<‘C’;} }
[试题]在下面程序横线处填上适当内容,使程序输出为:55599。 include using namespace std; te在下面程序横线处填上适当内容,使程序输出为:55599。include <iostream>using namespace std;template <class TYPE>class HisClass{TYPE data;public:H.isClass(TYPE a, TYPE b, TYPE C) ;TYPE getData(){ return data;)};templa
[试题]在下面程序的横线处填上适当的语句,使该程序的输出为12。 include using namespace st在下面程序的横线处填上适当的语句,使该程序的输出为12。include <iostream>using namespace std;class Base{public:int a;B.ase(int i){a=i;}};class Derived: public Base{int a;public:D.erived(int x): Base(x),b(x+l){}void show(){
[试题]在下面的程序的横线处填上适当的语句,使该程序的输出为12。 include using namespace在下面的程序的横线处填上适当的语句,使该程序的输出为12。include<iostream.h>using namespace std;class Base{public:int a,b;B.ase(int i){a=i;}};class Derived:public Base{int a;public:D.erived(int x):Base(x),b(x+1){};void show(){
[主观题]在下面程序横线处填上适当内容,使得程序的输出为9876。include using namespace std;te在下面程序横线处填上适当内容,使得程序的输出为9876。include <iostream>using namespace std;template<class T>void f([ ]){T t;for (int i=0;i<n/2;i++){t=a Ii];a [i]=a[n-1-i];a [n-1-i]=t;}}int main ( ){int x[]={6,7,8,9};f
[单选题]要使程序执行后的输出结果为ABCD,应在横线处添加语句( )。A.public AB.private AC.protected AD.virtual public A
[单选题]要使程序执行后的输出结果为ABCD,应在横线处添加语句()。includeusing namespace std;要使程序执行后的输出结果为ABCD,应在横线处添加语句( )。 #include<iostream> using namespace std; { public:A(){cout<<'A';} }; class B=______ { public:B(){cout<<'B';} }; class C:virtual public A { public:C(){cout<<'
[单选题]阅读下面程序,则执行后的输出结果为( )
[单选题]下面程序执行后的输出结果为( )。 public class fun { public static void main(String args[]) { String greets="How are you!"; String s=greets.substring(0,3); System.out.println(S); } }A.HowB.are.C.youD.how ate you!