#17-#20WA的看过来
查看原帖
#17-#20WA的看过来
947200
AIregister楼主2024/8/1 22:39
#include <bits/stdc++.h>
using namespace std;
int main () {
	char c;
	int cnt=0;
	while(cin >> c){
		if(c!=' '&&c!='\n'){
			cnt++;
		}
	}
	printf ("%d\n", cnt);
}

要用

while(cin>>c){
  xxxxxxx;
  xxxxxxx;
  xxxxxxx;
  xxxxxxx;
}
要不然遇到空格会停
2024/8/1 22:39
加载中...