Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
46731 老方 删除数字 C++ 通过 0 MS 244 KB 323 2024-05-05 10:46:15

Tests(1/1):


#include<bits/stdc++.h> using namespace std; int main(){ int qwertyuiopasdfghjklzxcvbnm,n; cin>>qwertyuiopasdfghjklzxcvbnm>>n; string s=to_string(qwertyuiopasdfghjklzxcvbnm); while(n--){ for(int i=0;i<s.size()-1;i++){ if(s[i]<s[i+1]){ s.erase(i,1); break; } } } cout<<s; return 0; }


测评信息: