3 条题解

  • 2
    @ 2024-7-20 12:00:47
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	string s;
    	getline(cin,s);
    	int i,cnt=0;
    	while(s[i]){
    		if(s[i]!=' ') cnt++;
    		i++;
    	}
    	cout<<cnt;
    	return 0;
    }
    
    • 0
      @ 2024-7-21 11:04:56

      #include<bits/stdc++.h> using namespace std; int main(){ string s; getline(cin,s); int i,cnt=0; while(s[i]){ if(s[i]!=' ') cnt++; i++; } cout<<cnt; return 0; }

      • -1
        @ 2024-7-21 10:36:29
        #include<bits/stdc++.h>
        using namespace std;
        int main(){
        	string s;
        	getline(cin,s);
        	int i,cnt=0;
        	for(i=0;i<s.size();i++){
        		if(s[i]!=' ') cnt++;
        	}
        	cout<<cnt;
        	return 0;
        }
        • 1

        信息

        ID
        2021
        时间
        1000ms
        内存
        256MiB
        难度
        3
        标签
        递交数
        228
        已通过
        116
        上传者