复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46#include<iostream> #include<vector> #include<string> #include<stack> #include<cmath> #include<cstdlib> #include<algorithm> #include<functional> #include<ctime> #include<iomanip> #include<cstring> #include <cstdio> #include <map> #include <set> #include <queue> #include <climits> #include<sstream> 里面有重要函数 ostringstream & istringstream using namespace std; string convertToString(double x) { ostringstream o; if(o<<x) return o.str(); return "conversion error"; } double convertToDouble(string s) / s里面不能含有字母 { istringstream i(s); double x; if(i>>x) return x; return 0; } int main() { string ss,ss1="1234"; for(int i=1;i<=10;i++) ss+=convertToString(i); cout<<ss<<endl; cout<<convertToDouble(ss1); }
最后
以上就是虚幻纸飞机最近收集整理的关于#include
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复