免费公司建站,WordPress移植typecho,信息类网站有哪些,开官网删数问题 Problem Description 键盘输入一个高精度的正整数n#xff08;≤100位#xff09;#xff0c;去掉其中任意s个数字后剩下的数字按照原来的左右次序组成一个新的正整数。编程对给定的n与s#xff0c;寻找一种方案#xff0c;使得剩下的数字组成的新数最小。Input … 删数问题 Problem Description 键盘输入一个高精度的正整数n≤100位去掉其中任意s个数字后剩下的数字按照原来的左右次序组成一个新的正整数。编程对给定的n与s寻找一种方案使得剩下的数字组成的新数最小。 Input 输入有多组 每组包括原始数n要去掉的数字数s Output 输出去掉s个数后最小的数 Example Input 178543 4 Example Output 13 #include stdio.h
#include stdlib.h
#include string.h
int main()
{ char s[150]; int n; while(~scanf(%s %d, s, n)){ while(n 0){ int len strlen(s); int i 0; while(i len s[i] s[i1]){ i; } while(i len){ s[i] s[i1]; i; } n--; } int k; while(s[0] 0){ k 0; int len strlen(s); while(k len){ s[k] s[k1]; k; } } printf(%s\n, s); } return 0;
}