2 条题解

  • 1
    @ 2025-12-21 14:20:07
    #include <bits/stdc++.h>
    using namespace std;
    int main() {
        string s;
        bool flag=true;
        while(cin>>s){
            if (flag){
                flag=false;
                cout<<s.size();
            }else
                cout<<","<<s.size();
        }
        return 0;
    }
    
    • -1
      @ 2025-12-17 19:59:54

      #include #include #include #include using namespace std;

      int main() { string line; getline(cin, line);

      vector<int> lengths;
      stringstream ss(line);
      string word;
      
      while (ss >> word) {
          lengths.push_back(word.length());
      }
      
      for (int i = 0; i < lengths.size(); i++) {
          if (i > 0) cout << ",";
          cout << lengths[i];
      }
      cout << endl;
      
      return 0;
      

      }

      • 1

      信息

      ID
      6977
      时间
      1000ms
      内存
      128MiB
      难度
      1
      标签
      递交数
      3
      已通过
      2
      上传者