赞
踩
本文为新手学习C++的练习记录
编写一个能够输出 Hello,World!
的程序。
提示:
Hello,World!
逗号后面没有空格。H
和 W
为大写字母。无
无
无
Hello,World!
#include <iostream>
#include <cstdio>
using namespace std;
int main(){
printf("Hello,World!");
return 0;
}
或者
#include <iostream>
using namespace std;
int main(){
cout << "Hello,World!";
return 0;
}
在上面两种方法中,分别用了printf()
和cout
,两者的区别在于
(不好意思,有点没看懂网上的解答)
那就随便点吧,感觉就是
cout
比printf()
用处更大,但是在很简单的情况下,cout
要比printf()
复杂一点。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。