#include <io.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h> void reverse(char s[])
{
int c,i,j; for(i = 0,j = strlen(s) - 1;i < j;i++,j--)
c = s[i],s[i] = s[j],s[j] = c;
} void itoa(int n,char s[],int b)
{
int i,sign,j; sign = n,i = 0; do
{
j = abs(n % b);
s[i++] = (j <= 9) ? j + '0' : j - 10 + 'a';
}while((n /= b) != 0); if(sign < 0)
s[i++] = '-';
s[i] = '\0';
reverse(s);
} int main()
{
int n,i,b;
char s[50];
n = -165;
b = 16; itoa(n,s,b); for(i = 0;i < strlen(s);i++)
printf("%c ",s[i]); return 0;
}

最新文章

  1. 基础的jdbc连接数据库操作
  2. java基本类型的默认值及其取值范围
  3. jieba中文分词的.NET版本:jieba.NET
  4. Pyqt 中__init__(self,parent==None) parent理解
  5. memcache/redis 缓存学习笔记
  6. CentOS 6.5 无网环境安装R及Rstudio的方法的方法
  7. Redis PHP通用类
  8. 11g新特性与12c新特性
  9. 云服务器 ECS Linux 系统中常见的日志文件介绍
  10. GridView绑定DataKeyNames以及如何取这些值
  11. EF CodeFirst系列(2)---CodeFirst的数据库初始化
  12. codeforces 915E - Physical Education Lessons 动态开点线段树
  13. javascript websocket 心跳检测机制介绍
  14. python之字符串拼接:%和format
  15. angular点击查看更多(简单demo)
  16. 2012年蓝桥杯省赛A组c++第3题(喝断片的海盗)
  17. 如何下载网页上的视频和flash的方法
  18. 如何知道我 的python是32位还是64位的?
  19. 两招解决异常_Cannot find any information on property &#39;XXX&#39; in a bean of type &#39;XXX&#39;的问题
  20. @Transational)的方法,注解失效的原因和解决方法

热门文章

  1. java实现 zip解压缩
  2. Jongmah CodeForces - 1110D
  3. 宁夏邀请赛F FLOYD
  4. 找回被丢弃怎么找都找不回来的git中的commit
  5. RSA 加解密算法详解
  6. eclipse、myeclipse 反编译插件 轻松查看源代码
  7. [转]全图形PPT设计指南
  8. 《Cracking the Coding Interview》——第18章:难题——题目12
  9. (原)C sharp杂谈记事(一)
  10. 【Binary Search Tree Iterator 】cpp