摘要: Print an integer using only putchar. Try doing it without using extra storage.1)void printInt(int a){ int b = a; char *str; int i = 1; int len = 0; while (b) { b /= 10; i *= 10; len++; } i /= 10; while (i > 0) { putchar(a/i + 48); a = a%i; i /= 10; }} 2)Thiscanbedonebyrecursion.Sincethenumberofre 阅读全文
posted @ 2011-06-17 20:19 westfly 阅读(229) 评论(0) 推荐(0)