为什么就只能得5分???求助
查看原帖
为什么就只能得5分???求助
304722
HarryPotterJames楼主2020/10/28 19:22
#include<bits/stdc++.h>
using namespace std;
int main()
{
	//freopen("title.in","r",stdin);
	//freopen("title.out","w",stdout);
	int n=0;
	string str;
	getline(cin,str);
	int j=str.length();
	for(int i=0;i<j;i++)
		if(str[i]==' '||str[i]=='\n')
			n++;
	cout<<n<<endl;
	return 0;
}
2020/10/28 19:22
加载中...