delete pics to save space
This commit is contained in:
31
history_source/信息学奥赛一本通/2.6.9.cpp
Normal file
31
history_source/信息学奥赛一本通/2.6.9.cpp
Normal file
@ -0,0 +1,31 @@
|
||||
#include<iostream>
|
||||
#include<string>
|
||||
using namespace std;
|
||||
using std::string;
|
||||
string a;
|
||||
int k;
|
||||
void operation()
|
||||
{
|
||||
int j;
|
||||
for(int i=0;i<k;i++)
|
||||
{
|
||||
j=0;
|
||||
while(j<a.size()-1&&a[j]<=a[j+1]) j++;
|
||||
a.erase(a.begin()+j);
|
||||
}
|
||||
while(a.size()>1&&a[0]=='0') a.erase(a.begin());
|
||||
}
|
||||
int main()
|
||||
{
|
||||
int t;
|
||||
cin>>t;
|
||||
string ans[t];
|
||||
for(int i=0;i<t;i++)
|
||||
{
|
||||
cin>>a>>k;
|
||||
operation();
|
||||
ans[i]=a;
|
||||
}
|
||||
for(int i=0;i<t;i++) cout<<ans[i]<<endl;
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user