http://acm.csu.edu.cn/OnlineJudge/problem.php?cid=2037&pid=9
【题解】:
这题卡了一下,卡在负数的情况,负数输出 0
这题主要找到一个个相邻重复的位置,然后加1上去,看是否进位,直到满足条件为止
【code】:
1 #include<iostream> 2 #include<stdio.h> 3 #include<string.h> 4 #include<stdlib.h> 5 using namespace std; 6 7 8 void inttostr(int n,char *str) 9 { 10 int cnt=0; 11 while(n) 12 { 13 str[cnt]=n%10+'0'; 14 n/=10; 15 cnt++; 16 } 17 str[cnt]='