178543 4Example Output
13Hint
Author
他強任他強,我吃我三狼。
說實話,這題做的頭皮發(fā)麻。
01 | #include<stdio.h> |
02 | #include<string.h> |
03 | int main() |
04 | { |
05 | int i, s, len, n; |
06 | char a[100]; |
07 | while ( scanf ( "%s" , a) != EOF) |
08 | { |
09 | n = 0; |
10 | scanf ( "%d" , &s); |
11 | while (s > 0) |
12 | { |
13 | i = 0; |
14 | len = strlen (a); |
15 | while (i < len && a[i] <= a[i+1]) |
16 | i++; |
17 | while (i < len) |
18 | { |
19 | a[i] = a[i+1]; |
20 | i++; |
21 | } |
22 | s--; |
23 | } |
24 | len = strlen (a); |
25 | while ((a[n] == '0' ) && (n < len)) n++; |
26 | if (n == len) |
27 | printf ( "0/n" ); |
28 | else |
29 | { |
30 | for (i = n; i < strlen (a); i++) |
31 | { |
32 | printf ( "%c" , a[i]); |
33 | } |
34 | printf ( "/n" ); |
35 | } |
36 | } |
37 | return 0; |
38 | } |
新聞熱點
疑難解答