-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathS_to_i.cpp
More file actions
37 lines (32 loc) · 813 Bytes
/
S_to_i.cpp
File metadata and controls
37 lines (32 loc) · 813 Bytes
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
#include <iostream>
#include <stdio.h> // printf,scanf
#include <stdlib.h>
#include <math.h>
#include <string>
#include <vector>
#include <algorithm> //sort,binarySearch
#include <functional>
#include <iomanip> // setprecision
#include <utility> // c+11 Array
#include <set>
#include <sstream>
#include <bits/stdc++.h>
#define PI 3.141592653589793238462643383279
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define debug(x) cout << #x << " = " << x << endl;
#define debret(x) debug(x) ; return 0;
using namespace std;
int S_to_i(string s);
int main(void){
const string input = "123";
cout << S_to_i(input) * 10 << endl;
return 0;
}
int S_to_i(string s){
int tmp = 0;
FOR(i,1,s.size()+1){
tmp += (s[i-1] -'0') * pow(10,s.size() - i);
}
return tmp;
}