蒟蒻0分求助!!急!!!
查看原帖
蒟蒻0分求助!!急!!!
756608
andy605楼主2023/9/17 11:13
#include <bits/stdc++.h>
using namespace std;
string str[202];
int maxn,minn,maxd,mind;
bool first=true;
int main(){
    int d=1,l;
    while(cin>>str[d]){
        if(str[d]=="\0") break;
        l=str[d].size();
        if(first){
            first=false;
            minn=l;
        }
        if(l<minn){minn=l;mind=d;}
        if(l>maxn){maxn=l;maxd=d;}
    }
    cout<<str[maxd]<<endl<<str[mind]<<endl;
    return 0;
}

0分求助!望大佬帮助!

2023/9/17 11:13
加载中...