c++程序设计 原理与实践 第一章、

版权声明:版权所有 sjn-superstar007 https://blog.csdn.net/weixin_43496525/article/details/83782078

c++程序设计 原理与实践

第一章

没有重要内容

第二章 hello word

2.2 cout发音see-out
输出操作符<<
2.3 源代码后缀 .cpp
目标代码后缀.obj

第一个程序

#include
#include
#include
#include
#include
using namespace std;
inline void keep_windows_open(){char ch;cin>>ch;}
int main()
{
cout << “hello,world!\n”;
keep_windows_open();
return 0;
}

第二个程序( 读取名字和年龄)

int main()
{
cout << “please enter your first name and age(followed by ‘enter’):\n”;
string first_name;
int age;
cin>>first_name;
cin>>age;
cout<<“Hello,”<<first_name<<"(age"<<age<<")\n";
}

猜你喜欢

转载自blog.csdn.net/weixin_43496525/article/details/83782078
今日推荐