get, getline, gets, getchar 用法

一、cin   一、cin>>   用法1:最基本,也是最經常使用的用法,輸入一個數字:   #include <iostream>   using namespace std;   main ()   {   int a,b;   cin>>a>>b;   cout<<a+b<<endl;   }   輸入:2[回車]3[回車]   輸出:5   用法2:接受一個字符串,遇「空格」、「TAB」、
相關文章
相關標籤/搜索