C++ Primer 读书笔记 - 第一章   
               添加时间:2013-5-20 点击量: 
 
              这一章算是简介。
本身写了几个法度。
1. main函数的返回值
int main()
{
    //after ./a.out, execute echo ¥?, it will output 7.
    return 7;
}
2. 对comment的懂得
#include <iostream>
using namespace std;
int main()
{
    cout << /;
    cout << /;
    cout << / / /;
}
3. 对输入的懂得
#include <iostream>
using namespace std;
int main()
{
    int a;
    int b;
    cin >> a >> b;
    cout << a << \t << b << endl;
    return 0;
}
4. 无穷输入
#include <iostream>
using namespace std;
int main()
{
    int sum = 0;
    int value;
    // Ctrl + D to end the input
    while (cin >> value)
        sum += value;
    cout << Sum is:  << sum << endl;
    return 0;
}
原来,再大的房子,再大的床,没有相爱的人陪伴,都只是冰冷的物质。而如果身边有爱人陪伴,即使房子小,床小,也觉得无关紧要,因为这些物质上面有了爱的温度,成了家的元素。—— 何珞《婚房》#书摘#
                     
                  
     
  
 
    
    
这一章算是简介。
本身写了几个法度。
1. main函数的返回值
int main()
{
//after ./a.out, execute echo ¥?, it will output 7.
return 7;
}
2. 对comment的懂得
#include <iostream>
using namespace std;
int main()
{
cout << /;
cout << /;
cout << / / /;
}
3. 对输入的懂得
#include <iostream>
using namespace std;
int main()
{
int a;
int b;
cin >> a >> b;
cout << a << \t << b << endl;
return 0;
}
4. 无穷输入
#include <iostream>
using namespace std;
int main()
{
int sum = 0;
int value;
// Ctrl + D to end the input
while (cin >> value)
sum += value;
cout << Sum is: << sum << endl;
return 0;
}
原来,再大的房子,再大的床,没有相爱的人陪伴,都只是冰冷的物质。而如果身边有爱人陪伴,即使房子小,床小,也觉得无关紧要,因为这些物质上面有了爱的温度,成了家的元素。—— 何珞《婚房》#书摘#




