为什么输入3他只让我输两行?
  • 板块学术版
  • 楼主WaltVBAlston
  • 当前回复8
  • 已保存回复8
  • 发布时间2021/7/12 17:01
  • 上次更新2023/11/4 14:59:59
查看原帖
为什么输入3他只让我输两行?
261262
WaltVBAlston楼主2021/7/12 17:01

RT

#include<iostream>
using namespace std;
string s[21],ans;
int n;
int main(){
	cin>>n;
	for(int i=1;i<=n;i++)
		getline(cin,s[i]);
	return 0;
}

这份代码,我输入n=3,但是只能输入两行字符串,这是为啥?

2021/7/12 17:01
加载中...