提交 387072f5 编写于 作者: 道标 · 年's avatar 道标 · 年 🙂

删除 寻找最大数

上级 74168179
#include<stdio.h>
#include<string.h>
#include<iostream>
using namespace std;
int main()
{
int len, k, m;
char s[110], c;
cin >> k;
while(k--)
{
getchar();
cin >> s >> m;
len = strlen(s);
int i = 0,j = 0;
while(m < len)
{
c = s[j];
for(i = j; i <= m; i++)
{
if(c < s[i])
{
c = s[i];
j = i;
}
}
cout << c;
j++;
m++;
}
cout << endl;
}
return 0;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册