哪位高手帮忙看看这段程序是哪出问题了?

来源:百度知道 编辑:UC知道 时间:2024/06/07 13:58:57
#include <iostream>
int mian()
{
std::cout<<"hello there!\n";
std::cout<<"Here is 5:"<<5<<"\n";
std::cout<<"The manipulator std::end1";
std::cout<<"wtites a new line to the screen.";
std::cout<<std::end1;
std::cout<<"Here is a very big number:\t"<<70000;
std::cout<<std::end1;
std::cout<<"Here is the sum of 8and 5:\t";
std::cout<<8+5<<std::end1;
std::cout<<"here's a fraction:\t\t";
std::cout<<(float)5/8<<std::end1;
std::cout<<"And a very very big number:\t";
std::cout<<(double)7000*7000<<std::end1;
std::cout<<"Don't forget to replace jesse Liberty";
std::cout<<"with yuor name...\n";
std::cout<<"

出错原因是,那个是endl(小写L),不是end1!
还有:不用每句输出语句语句前面都加上std::
直接在#include <iostream>下面加上一句using namespace std;就行
#include <iostream>
using namespace std;
int main()
{
cout<<"hello there!\n";
cout<<"Here is 5:"<<5<<"\n";
cout<<"The manipulator std::endl";
cout<<"wtites a new line to the screen.";
cout<<endl;
cout<<"Here is a very big number:\t"<<70000;
cout<<endl;
cout<<"Here is the sum of 8and 5:\t";
cout<<8+5<<endl;
cout<<"here's a fraction:\t\t";
cout<<(float)5/8<<endl;
cout<<"And a very very big number:\t";
cout<<(double)7000*7000<<endl;
cout<<"Don't forget to replace jesse Liberty";
cout<<"with yuor name...\