第一个C++程序

Posted on 2006-03-07 20:37 天涯浪子 阅读(1683) 评论(5)  编辑 收藏 引用
因为是第一次在C++博客上安家,所以小弟我先在此献丑,写个Hello程序献给朋友们。
#include <iostream>
using namespace std;
int main()
{
    cout<<"Hello , This is my first home for C++."<<endl;
    cout<<"I am very like it!"<<endl;
    cout<<"I'll stay here.OK."<<endl;
    return 0;
}
这个小程序只是让大家对C++有个眼熟,不要被它吓倒,其实他并不难,不是吗,不信你看看,就那么几行呀,呵呵。不过话说回来,成功还得付出努力,学习本来就是个严谨的过程,做技术的更是如此,所以还需努力才行。
 好了,就写到这里吧。

Feedback

# re: 第一个C++程序  回复  更多评论   

2006-03-09 11:12 by 任我行
哈哈,大家一起学习。。。

# re: 第一个C++程序  回复  更多评论   

2006-03-12 11:36 by
加油加油!

# re: 第一个C++程序  回复  更多评论   

2006-05-28 17:55 by beyonlin
"I am very like it!"------>"I like it very much!"
这样改可能更好一些。

# re: 第一个C++程序  回复  更多评论   

2006-05-28 20:36 by TH
#include <iostream>
using std::cout;
using std::endl;

int main(int argc, char* argv[])
{
cout<<"Hello , This is my first home for C++."<<endl;
cout<<"I am very like it!"<<endl;
cout<<"I'll stay here.OK."<<endl;
return 0;
}

学习本来就是个严谨的过程,做技术的更是如此,所以还需努力才行。
好了,就写到这里吧。

# 帮运行一下这个程序好啊!  回复  更多评论   

2006-12-03 19:58 by 直面人生
 #include<iostream.h>
 void fn1();
 int x=1,y=2;
 void main()
 {
 cout<<"Begin..."<<endl;
 cout<<"x="<<x<<endl;
 cout<<"y="<<y<<endl;
 cout<<"Evaluate x and y in main()..."<<endl;
 int x=10,y=20;
 cout<<"x="<<x<<endl;
 cout<<"y="<<y<<endl;
 cout<<"Step into fn1()..."<<endl;
 fn1();
 cout<<"Back in main"<<endl;
 cout<<"x="<<x<<endl;
 cout<<"y="<<y<<endl;
 }
 void fn1()
 {
 int y=200;
 cout<<"x="<<x<<endl;
 cout<<"y="<<y<<endl;

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理


posts - 15, comments - 31, trackbacks - 0, articles - 13

Copyright © 天涯浪子