CE求正确代码
查看原帖
CE求正确代码
907805
Harry_STEAM楼主2023/1/10 12:18
#include<bits/stdc++.h>
using namespace std;
int main(){
    string a,word;
    int s;
    getline(cin,a);
    for(int i=1;i<=a.length();i++){
        if(a[i]!=' ')
            strcpy(word,a[i]);
        if(a[i]==' ')&&(a[i-1]!=' '){
            s=word.length();
            cout<<s;
        }
        else
            continue;
    }
    return 0;
}
2023/1/10 12:18
加载中...