蒟蒻求救
  • 板块灌水区
  • 楼主osfly
  • 当前回复13
  • 已保存回复13
  • 发布时间2020/9/5 20:25
  • 上次更新2023/11/5 13:40:55
查看原帖
蒟蒻求救
339299
osfly楼主2020/9/5 20:25

这是蒟蒻第nn次求救

不要问我为什么要用LaTeX\LaTeX(可恶这个LaTeX竟然画不上线

原题传送men

mymy codecode

#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;
}

二手代码(别人改过也没办法

2020/9/5 20:25
加载中...