Why 0pts?
查看原帖
Why 0pts?
1049033
luogu_00楼主2024/12/7 21:22
#include<bits/stdc++.h>
using namespace std;
string words;
int length[300];
int main(){
    int i=0;
    getline(cin,words);
    for(int j=0;j<words.length();j++){
        if(words[j]==' '){
            if(words[j-1]!=' '){
                i++;
            }
            continue;
        }
        length[i]++;
    }
    for(int j=0;j<i;j++){
        cout<<length[j];
        if(j!=i-1){
            cout<<",";
        }
    }
    return 0;
}

为什么这段代码只能得 00 分?求 dl。

2024/12/7 21:22
加载中...