unexpected end of file found#includeusing namespace std;int gcd(int m,int n){if(m0){int r=m%n;m=n;n=r;}return m;}class Ratio{public:Ratio(int n=0,int d=1):num(n),den(d){cout

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/28 15:37:15
unexpectedendoffilefound#includeusingnamespacestd;intgcd(intm,intn){if(m0){intr=m%n;m=n;n=r;}returnm

unexpected end of file found#includeusing namespace std;int gcd(int m,int n){if(m0){int r=m%n;m=n;n=r;}return m;}class Ratio{public:Ratio(int n=0,int d=1):num(n),den(d){cout
unexpected end of file found
#include
using namespace std;
int gcd(int m,int n)
{
if(m0){int r=m%n;m=n;n=r;}
return m;
}
class Ratio
{public:
Ratio(int n=0,int d=1):num(n),den(d)
{cout

unexpected end of file found#includeusing namespace std;int gcd(int m,int n){if(m0){int r=m%n;m=n;n=r;}return m;}class Ratio{public:Ratio(int n=0,int d=1):num(n),den(d){cout
代码应该这样写:
1、不要把多个语句,写在一行
2、大括号要单独一行,注意缩进
3、函数之间,或者独立的语句块之间,空一行
#include
using namespace std;
int gcd(int m,int n)
{
if(m0)
{
int r=m%n;
m=n;
n=r;
}
return m;
}
class Ratio
{
public:
Ratio(int n=0,int d=1):num(n),den(d)
{
cout