筱羅卜 2015-06-11 02:24 采纳率: 100%
浏览 1844
已采纳

这个程序问题出在哪啊?麻烦各路大神指教

程序如下:
#include
using namespace std;
class CFraction
{
private:
int nume;
int deno;
public:
CFraction(int nu=0,int de=1):nume(nu),deno(de) {}
void set(int nu=0,int de=1) {nume=nu;deno=de;}
void input()
{
char c;
cout<<"请输入数据(格式:nu/de):"< while(1)
{
cin>>nume>>c>>deno;
if(c!='/')
cout<<"格式错误!请重新输入数据:"< else
break;
}
void simplify()
{
int r, n,d;
cout cin>>n>>d;
while(r!=0)
{
r=d%n;
d=n;
n=r;
}
}
void amlify(int n)
{
int c;
c=input;
c*=n;
}
void output(int style=0)
{
cout<<nume<<"/"<<deno<<endl;
}
};
int main()
{
CFraction a(3,7),b(6,8),c(1,7);
a.output();
a.set(2,5);
a.output();
a.input();
b.simplify();
b.output();
c.amplify(5);
c.output();
return 0;
}
编译时显示:
--------------------Configuration: f - Win32 Debug--------------------
Compiling...
f.cpp
D:\C++项目\f\f.cpp(59) : fatal error C1004: unexpected end of file found
执行 cl.exe 时出错.

f.obj - 1 error(s), 0 warning(s)

  • 写回答

5条回答 默认 最新

  • Tiger_Zhao 2015-06-11 02:27
    关注

    这通常是头文件重复引用出的错误。
    又:请用代码格式贴。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 latex怎么处理论文引理引用参考文献
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
  • ¥15 乘性高斯噪声在深度学习网络中的应用