int_to_string
来源:互联网 发布:网络语言1是什么意思 编辑:程序博客网 时间:2024/06/06 04:21
#include <stdio.h>#include <string.h>void reverse(char s[]){ int i, j, temp; for (i = 0, j = strlen(s) - 1; i < j; ++i, --j) { temp = s[i]; s[i] = s[j]; s[j] = temp; }} void my_itoa(int n, char s[]){ int i, sign; if ((sign = n) < 0) n = -n; i = 0; do { s[i++] = n % 10 + '0'; } while ((n /= 10) > 0); if (sign < 0) s[i++] = '-'; s[i] = '\0'; reverse(s);}int main(){ char s[10000]; int n = -13352; my_itoa(n, s); puts(s); return 0;}
0 0
- int_to_string
- string_to_int与int_to_string
- LeetCode-38-Count and Say Python的int_to_string
- 关联容器(二)
- jaxb解析xml忽略命名空间
- Android程序如何实现从网络中获取一张图片
- [Unity3D]Unity3D游戏开发之继续探索NGUI
- libgdx demo apk 分享
- int_to_string
- CV领域的实验室及研究组
- android:json解析的两个工具:Gson和Jackson的使用小例子
- NYOJ891-找点
- C++对象模型那点事儿(布局篇)
- XP环境 boot.ini 关闭 DEP
- XML—尝试对一个XML文档进行增删查改编程
- What is the difference between /dev/ttyUSB and /dev/ttyACM
- C函数解析MP3信息