键盘输入一个高精度的正正数N,去掉其中任意S个数字后剩下的数字按原左右次序组成一个新的正整数 编程对给定的N和S,寻找一种方案使得剩下的数字组成的新数最小 #include <iostream> #include <cstring> using namespace std; int main() { char str[256]; memset(str, 0, sizeof(str)); cin >> str; int iDelLen; cin >> iDelLen; size_t iLen = strlen(str); for (int i = 0; i < iDelLen; i++) { size_t j; for ( j = 0; j < iLen; j++) { if (str[j] > str[j+1]) break; } if ( j == iLen) str[iLen - 1] = 0; else memmove(str+j, str+j+1, iLen - j); iLen--; } cout << str <<endl; return 0; }