这是蒟蒻第n次求救
不要问我为什么要用LATEX(可恶这个LaTeX竟然画不上线
my code
#include<string>
#include<cstring>
#include<cstdio>
#include<iostream>
using namespace std;
char str[50000];
string maxstr;
int Max=0;
string minstr;
int Min=101;
string now;
int ans;
int main()
{
gets(str);
for(int i=0;i<strlen(str);i++)
{
if(str[i]==' '||str[i]==',')
{
if(ans>Max)
{
Max=ans;
maxstr=now;
}
else if(ans<Min)
{
Min=ans;
minstr=now;
}
ans=0;
}
else
{
now[ans]=str[i];
ans++;
}
}
cout<<maxstr<<endl<<minstr;
return 0;
}
二手代码(别人改过也没办法