#include "stdafx.h"
#include <stdlib.h>
#include <iostream>
using namespace std;
int main() { 
	//using std::cout;
	//using std::endl;
	cout << "Hello, world" << endl;//前面已定义std,则后面可以直接调用,不必写std::cout...
	//using std::cout;
	//using std::endl;
	//std::cout<<"hello world."<<std::endl;
	//cout<<"hello world."<<endl;
	system("pause");
	return 0;
}

Hello, world

请按任意键继续. . .

-------------------------------------------------------------------------------------------------------------

#include "stdafx.h"
#include <stdlib.h>
#include <iostream>
//using namespace std;
int main() { 
	using std::cout;
	using std::endl;//此处定义std
	cout << "Hello, world" << endl;//此处可以直接调用
	//using std::cout;
	//using std::endl;
	//std::cout<<"hello world."<<std::endl;
	//cout<<"hello world."<<endl;
	system("pause");
	return 0;
}

Hello, world
请按任意键继续. . .
-------------------------------------------------------------------------------------------------------------

#include "stdafx.h"
#include <stdlib.h>
#include <iostream>
//using namespace std;
int main() { 
	//using std::cout;
	//using std::endl;
	//cout << "Hello, world" << endl;
	//using std::cout;
	//using std::endl;
	std::cout<<"hello world."<<std::endl;//前面没有定义std,则在调用cout时,需写成std::cout...才行
	//cout<<"hello world."<<endl;
	system("pause");
	return 0;
}

hello world.
请按任意键继续. . .
 

 

 

Logo

一站式虚拟内容创作平台,激发创意,赋能创作,进入R空间,遇见同道,让优质作品闪耀发光。​

更多推荐