为什么都定义字符串啊,一个字符不就过了吗
查看原帖
为什么都定义字符串啊,一个字符不就过了吗
1039487
JDDJHY楼主2023/8/22 20:27
#include<bits/stdc++.h>
using namespace std; 
int main(){  
	char a;int s=0;
	while((a=getchar())!='\n')
	{
		if(a!=' ')s++;
	}
	cout<<s;
    return 0;
} 
2023/8/22 20:27
加载中...