c++程式設計 原理與實踐 第一章、
阿新 • • 發佈:2018-11-16
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";
}