鱼C论坛

 找回密码
 立即注册
查看: 2071|回复: 0

3.VS2012第一个经典C++程序:Hello World!

[复制链接]
发表于 2013-3-6 22:29:24 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
本帖最后由 (@_@) 于 2013-3-7 11:59 编辑
% p. T5 B8 {1 W3 _9 r8 V3 q1 m
/ \$ A6 y/ m2 g( B( L第一种写法:, d2 G* t8 ?* P6 c" |* Q
#include <iostream>% s" L5 |+ E( J. t, G) ]* L4 J
using namespace std;  k, b  P: D5 G
int main(void). i2 ?" {5 t0 E9 }& Z+ H
{
* }3 h/ [$ \& I) d( c- G' u cout<<"Hello World!"<<endl;
8 i6 N. }% ?; p9 T system("pause");% {( D; Q' s  f6 y2 L0 c/ Y
return 0;
. u1 w% C6 K3 v6 J+ A4 C2 F/ j% o}
7 n: M$ \( @: l% S' X第二种写法:. W8 Y$ T; R/ J
#include <iostream>; i$ d1 c# \" k, d0 @
int main(void)
. |0 z+ p) K+ H4 W{
2 ?4 ~' {; p( R6 x" y$ z4 h std::cout<<"Hello World!\n";
$ v% `1 C# Q3 Y( R9 T, c% ` system("pause");
7 h+ x# o! `5 u( n' Z return 0;% L; p/ H2 n' T" h
}$ Z6 f  ?5 b2 j( y0 {7 z
第三种写法:  {  `+ J5 s" |  q, g$ U
#include <iostream>1 |" k7 P0 l) x8 K$ _& K
using std::cout;
& y3 U% w  w; V4 g; n, z2 {  Rint main(void)1 e- `3 U7 Z% m
{5 `5 `5 t+ c. w2 y3 D
cout<<"Hello World!\n";
, f/ l- v. Q) J, P+ D% s system("pause");
# l6 n% m0 H; L! e* W/ X7 J# g return 0;9 S1 h3 L1 M, r( e
}- P3 x5 n$ `) s$ X" d2 i+ k
第四种写法:(这种写法不适合VS2012,但适合VC6.0)
' o8 u. p$ l7 `6 g* ]5 @#include <iostream.h>0 e6 O5 }9 ^$ }) A; U0 C
int main(void)( |5 A1 l+ K4 X3 w, c
{
: U2 }3 J' l: x9 G' j cout<<"Hello World!\n";
* O7 R3 P( c" w$ E system("pause");5 d9 [1 D' L: Z7 V" \
return 0;
" h, B2 r3 q) s5 f' z9 S}
  v: D# `: b& f
& s6 \7 K, ]& Z: a9 D) _
* V1 L5 g- I& ?
小甲鱼最新课程 -> https://ilovefishc.com

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-10-22 00:02

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表