这个程序哪里有问题?

来源:百度知道 编辑:UC知道 时间:2024/06/29 01:36:50
#include <iostream>
int main()
{
int x = 5;
int y = 7;
std::cout << endl;
std::cout << x + y << " " << x * y;
std::cout << end;
return 0;
}

帮我改一下把 VC6

#include <iostream>
#include<stdlib.h>
using namespace std;

int main()
{
int x = 5;
int y = 7;
std::cout << endl;
std::cout << x + y << " " << x * y;
std::cout << endl;
system("pause");
return 0;
}
ok了

std::cout << endl;
std::cout << x + y << " " << x * y;
std::cout << end;

上下两个 end 不一样
到底是 end 还是 end1

#include <iostream>
int main()
{
int x = 5;
int y = 7;
std::cout << endl;
std::cout << x + y << " " << x * y;
std::cout << endl; //原先此处出错
return 0;
}

不是吧,应该endl前也要std::才行啊,它也在名字空间std里.
std::cout << std::endl;
std::cout << x + y << " " << x * y;
std::cout << std::endl;