***[here](https://www.luogu.com.cn/problem/solution/P1032)***
by 0_QAQ_0 @ 2024-02-05 16:06:49
```cpp
string s1, s2;
while(cin >> s1 >> s2){
// do sth
}
```
可否?
by __My0217__ @ 2024-02-05 16:13:28
```cpp
n = 1;
while (~scanf("%s%s", A[n], B[n])) n ++;
n --;
```
或者
```cpp
n = 1;
while (std::cin >> A[n] >> B[n]) n ++;
n --;
```
by moonspace @ 2024-02-05 16:21:38
谢谢dalao
by protractor @ 2024-02-05 20:54:03