最近在准备编程比赛,复习一下之前学过的内容,太久不看确实生疏了
1.普通输入 cin
用cin做字符输入命令时,如果有空格,TAB,回车,就表示结束。
#include <iostream>
using namespace std;
int main(
{
string a,b;
cin>>a>>b;
cout<<a<<endl;
cout<<b<<endl;
return 0;
2.getline()
想起来了,这个才是我去年常用的
```python
#include <bits/stdc++.h>
using namespace std;
int main(){
string s;
getline(cin,s)
cout<<s;
return 0;
}