leetcode 008 —— String to Integer (atoi)
2015-07-07 21:23
288 查看
Implement atoi to
convert a string to an integer.
详细的转换方法在此处点击打开链接
思路:使用流操作
class Solution {
public:
int myAtoi(string str) {
stringstream ss; //在vs2013中 需要设置为 strstream ss; #include<strstream>
ss << str;
int n;
ss >> n;
return n;
}
};
convert a string to an integer.
详细的转换方法在此处点击打开链接
思路:使用流操作
class Solution {
public:
int myAtoi(string str) {
stringstream ss; //在vs2013中 需要设置为 strstream ss; #include<strstream>
ss << str;
int n;
ss >> n;
return n;
}
};
相关文章推荐
- 将 EGL 代码与 DXGI 和 Direct3D 进行比较
- 加密技术在移动开发中的应用
- 瀑布流和图片缩放swift版
- Activity的四种launchMode
- leetCode 28.Implement strStr() (实现字符串匹配函数) 解题思路和方法
- bzoj-3172 单词
- WCF - Architecture
- 《opencv 入门教程》
- Windows下SVN命令行工具使用详解
- 什么是高大上的数据分析方法?
- Windows下SVN命令行工具使用详解
- EL表达式整理总结
- 推荐系统中常用算法 以及优点缺点对比
- 【android】开发笔记---存储篇
- iis 在站点中新建虚拟目录站点之后,虚拟目录中的 web.config 与 主站点中的 web.config冲突解决方案
- ASP.NET MVC WebApi 返回数据类型序列化控制(json,xml)
- C语言求大数阶乘
- Java 多线程
- 准备面试可以关注的问题------胡老师给的金玉良言
- 虚幻4 2d状态机动画基础