Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
46741 | Jerry | 删除数字 | C++ | Compile Error | 0 MS | 0 KB | 274 | 2024-05-05 10:54:55 |
#include<bits/stdc++.h> using namespace std; string n; int k; int main(){ cut>>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==l) n.erase(l-1,1); } cout<<n; return 0; }