Home > Back-end >  C a small white, online solution
C a small white, online solution

Time:03-27

CodePudding user response:

#include
Using the name space STD.
#include
The class date {
Private:
Int year;
Int the month;
The int data;
Public:
Void cin1;
Void cout1;
Void cout2;
Void cout3;
String fun (int a);
}
Void date: : cin1 () {
cout<" Please enter the year month day: "& lt; cin> Year> Month> Year;
If (data> 31 | | data1)
{cout<" Does not conform to that date, please input again "& lt; If (month> 12 | | month<1)
{cout<" Does not conform to that date, please input again "& lt; }
Void date: : cout1 () {
cout }
Void date: : cout2 () {
cout}
Void date: : cout3 () {
cout}
{string date: : eq (int a)
{switch (a)
Case1: return January;
Case2: return February;
Case3: return March;
Case4: return (research;
Case5: return May;
Case6: return June;
Case7: return out;
Case8: return August;
Case9: return September;
Case10: return October;
Case11: return another awarding;
Case12: return November;
}
}
Int main ()
{
The date box;
Box. Cin1 ();
Box. Cout1 ();
Box. Cout2 ();
Box. Cout3 ();
return 0;
}

CodePudding user response:

reference ~ # 1/f, north ink dye response:
# include
Using the name space STD.
#include
The class date {
Private:
Int year;
Int the month;
The int data;
Public:
Void cin1;
Void cout1;
Void cout2;
Void cout3;
String fun (int a);
}
Void date: : cin1 () {
cout<" Please enter the year month day: "& lt; cin> Year> Month> Year;
If (data> 31 | | data1)
{cout<" Does not conform to that date, please input again "& lt; If (month> 12 | | month<1)
{cout<" Does not conform to that date, please input again "& lt; }
Void date: : cout1 () {
cout }
Void date: : cout2 () {
cout}
Void date: : cout3 () {
cout}
{string date: : eq (int a)
{switch (a)
Case1: return January;
Case2: return February;
Case3: return March;
Case4: return (research;
Case5: return May;
Case6: return June;
Case7: return out;
Case8: return August;
Case9: return September;
Case10: return October;
Case11: return another awarding;
Case12: return November;
}
}
Int main ()
{
The date box;
Box. Cin1 ();
Box. Cout1 ();
Box. Cout2 ();
Box. Cout3 ();
return 0;
}

Ask the wrong code?

CodePudding user response:

See annotation problem, syntax error modification, for reference:
 # include 
#include

using namespace std;//using the name space STD.

The class date {
Private:
Int year;
Int the month;
The int data;
Public:
Void cin1 ();//void cin1; .
Void cout1 ();
Void cout2 ();
Void cout3 ();
String eq (int a);//string fun (int a);
};//missing '; '
Void date: : cin1 () {
cout<" Please enter the year month day: "& lt; While (cin> Year> Month> Data) {//cin> Year> Month> Year;
If (data> 31 | | data<1 | | month> 12 | | month 31 | | data1)
{cout<" Does not conform to that date, please input again "& lt; The else break;
}

//if (month> 12 | | month<1)
//{cout<" Does not conform to that date, please input again "& lt; }
Void date: : cout1 () {
cout }
Void date: : cout2 () {
cout}
Void date: : cout3 () {
cout}
{string date: : eq (int a)
{switch (a)
Case1: return "January"; break;//case1: return January; .
Case2: return "February"; break;
Case3: return "March"; break;
Case4: return "research"; break;
Case5: return "May"; break;
Case6: return "June"; break;
Case7: return "out"; break;
Case8: return "August"; break;
Case9: return "September"; break;
Case10: return "October"; break;
Case11: return "another awarding"; break;
Case12: return "November"; break;
}
}
Int main ()
{
The date box;
Box. Cin1 ();
Box. Cout1 ();
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related