!
#include <string>
#include <vector>
using namespace std;
int solution(string s) {
int answer = 0;
if(s.at(0)=='+')
{
answer=stoi(s.substr(1));
}
else if(s.at(0)=='-')
{
answer=stoi(s);
}
else
{
answer = stoi(s);
}
return answer;
}
[익힐것]
string s;
s.at(0) : s의 맨앞 반환
stoi : string to int
substr : string을 index부터 len만큼 잘라서 반환하는 함수, 스트링 짤라서 반환.
https://blockdmask.tistory.com/338 : string 관련