Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
46735 yuzhengxun 删除数字 C++ 编译错误 0 MS 0 KB 270 2024-05-05 10:51:02

Tests(0/0):


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


测评信息: