#include <iostream>
using namespace std;
class ceshi
{
public:
void output(int year)
{
cout<<year;
}
}
int main()
{
ceshi A;
int year;
cin>>year;
A.output(year);
return 0;
}
改正一下,并说明为什么错了?
#include <iostream>
using namespace std;
class ceshi
{
public:
void output(int year)
{
cout<<year;
}
}
int main()
{
ceshi A;
int year;
cin>>year;
A.output(year);
return 0;
}
改正一下,并说明为什么错了?
#include <iostream>
using namespace std;
class ceshi
{
public:
int year;
void output( )
{
cout<<year;
}
void intput( )
{
cin>>year;
}
int main()
{
ceshi A;
A.intput()
A.output();
return 0;
}