字符串转整数
来源:互联网 发布:3d游戏编程入门经典 编辑:程序博客网 时间:2024/05/22 12:24
#include<stdio.h> #include<string.h> int main(int agrc,char *agrv[]) { char str[1024]; char temp[1024]; int lenth; int i ; int n=0; long t =0; int j; memset(str,0,1024); memset(temp,0,1024); printf("Please input a string\n"); scanf("%s",str); lenth = strlen(str); for(i=0;i<lenth;i++) { if(str[i]>='0'&&str[i]<='9') { temp[n]=str[i]; n++; } } for(i=0;i<n;i++) { t*=10; t+=(temp[i]-'0'); } printf("%s\n",str); printf("%s\n",temp); printf("%i\n",t); printf("%i\n",atoi(temp)); printf("%x\n",atoi(temp)); printf("%x\n",t); return 0; }
- 字符串处理------字符串转整数
- 数字字符串转整数
- 整数转字符串
- 字符串转整数
- 字符串转整数
- 字符串转整数
- 字符串转整数
- 字符串转整数
- 20. 字符串转整数
- 字符串转整数
- 字符串转整数
- CSDN-字符串转整数
- 整数转字符串
- c字符串转整数
- 字符串转整数问题
- 字符串转整数(C#)
- c 整数转字符串
- 字符串 转整数
- 模拟对另一进程的窗口按钮的点击
- 遍历统计、移动和倒排
- gprs驱动程序设计实例
- 又要重写?!
- 不公平的社会
- 字符串转整数
- test
- HDU 1086 计算几何 求线段交点(吉大模板)
- C语言介绍维基百科
- [DLX] [NOI2005] 智慧珠游戏
- 餐桌上的“爱心菜”
- phpMyAdmin 及 MySQL 中文乱码 解决方案
- 收缩SQL SERVER数据库
- adodb.recordset.open