文章

1

粉丝

280

获赞

0

访问

7.8k

头像
不知道为啥过不了!!!
P1555 安徽大学机试题
发布于2020年4月5日 21:15
阅读数 7.8k

#include<bits/stdc++.h>
using namespace std;

map<int,string> M;

int main(){
    string str,temp_str;
    int i,j,count;
    while(getline(cin,str)){
        M.clear();
        i=0,count=0;
        temp_str="";
        for(j=i;str[j]!=' '&&j<str.size();j++){
            temp_str+=str[j];
            count++;
        }
        M[count]=temp_str;
        cout<<temp_str<<" "<<count<<endl;
        for(i=1;i<str.size();i++){
            if(str[i-1]==' '&&str[i]!=&...

登录查看完整内容


登录后发布评论

1 条评论
admin SVIP
2020年4月8日 13:27

可以看看其他同学的答案哦wink

赞(0)