-3

每次我尝试编译它时,我都会收到一条错误消息

“exercise3.cpp:10:49: 错误: 预期 ';' 在'endl'之前”

如果我在收到错误消息;之前添加endl

“exercise3.cpp:8:71:错误:语句无法解析重载函数的地址”

我不知道这是什么问题,所以任何帮助将不胜感激。

代码:(很抱歉没有正确排列,但我向你保证是的。)

#include "iostream"
using namespace std;

 int main()
 {
    cout << "hello there!\n";
    cout << "here is 5: "<< 5 << "\n";
    cout << "the manipulator end1 wrotes a new line to the screen."; endl;
    cout << "here is a very bug number:\t" << 70000 endl;
    cout << "here is the sum of 8 and 5:\t" << 8+5 endl;
    cout << "heres a fraction:\t\t" << (float) 5/8 endl;
    cout << "and a very big number:\t" << (double) 70000*70000 endl;
    cout << "you really dont have to type this line XD\n";
    cout << "or this one :P cause its not really needed!\n";
    return 0;
 }
4

3 回答 3

2

您需要<<endl.

于 2013-08-22T02:13:19.453 回答
2
cout << "the manipulator end1 wrotes a new line to the screen."; endl;

应该

cout << "the manipulator end1 wrotes a new line to the screen." << endl;

等等

于 2013-08-22T02:13:29.783 回答
1

你需要 << 在每个 endl 之前。

于 2013-08-22T02:12:48.843 回答