입력
첫째 줄에 피연산자의 개수(1 ≤ N ≤ 26) 가 주어진다. 그리고 둘째 줄에는 후위 표기식이 주어진다. (여기서 피연산자는 A~Z의 영대문자이며, A부터 순서대로 N개의 영대문자만이 사용되며, 길이는 100을 넘지 않는다) 그리고 셋째 줄부터 N+2번째 줄까지는 각 피연산자에 대응하는 값이 주어진다. 3번째 줄에는 A에 해당하는 값, 4번째 줄에는 B에 해당하는값 , 5번째 줄에는 C ...이 주어진다, 그리고 피연산자에 대응 하는 값은 100보다 작거나 같은 자연수이다.
후위 표기식을 앞에서부터 계산했을 때, 식의 결과와 중간 결과가 -20억보다 크거나 같고, 20억보다 작거나 같은 입력만 주어진다.
출력
계산 결과를 소숫점 둘째 자리까지 출력한다.
	for (int i = 0; i < inputStr.length(); i++) {
    	//사칙연산 기호라면 
		if (inputStr[i]== '+' || inputStr[i] == '-' || inputStr[i] == '*' || inputStr[i] == '/')
		{
			inputStrS.push_back(inputStr[i]);
		}
        //알파벳이라면 'A'값을 빼 몇번째 알파벳인지 알수있게 처리
		else {
			inputStrS.push_back((int)(inputStr[i]-'A'));
		}
			
	}이런식으로 char형 vector에 넣어주었다.
char형에는 -127부터 127까지의 integer값이 들어갈 수 있으므로,
char형 벡터에 int형으로 몇번째 알파벳인지를 넣어준 후,
		//값이 숫자라면 스택에 푸시
		else {
			ans.push(inputArr[inputStrS[i]]);
		}이런 식으로 char형에 저장된 int형 변수를 index값으로 사용하였다.
#include<iostream>
#include<stack>
#include<vector>
using namespace std;
int N;
string inputStr;
int inputArr[27];
vector<char> inputStrS;
stack<double> ans;
void input() {
	cin >> N>>inputStr;
	for (int i = 0; i < N; i++) {
		cin >> inputArr[i];
	}
	//inputStr문자열을 char형으로 하나하나 뜯어봄
	for (int i = 0; i < inputStr.length(); i++) {
		//사칙연산 기호가 있다면
		if (inputStr[i]== '+' || inputStr[i] == '-' || inputStr[i] == '*' || inputStr[i] == '/')
		{
			inputStrS.push_back(inputStr[i]);
		}
		//알파벳이라면 'A'값을 빼준후 int형으로 형변환하여 넣어줌.
		else {
			inputStrS.push_back((int)(inputStr[i]-'A'));
		}
			
	}
}
void solution() {
	double tmp1 = 0, tmp2 = 0;
	for (int i = 0; i < inputStrS.size(); i++) {
		//연산기호라면 마지막 두 숫자 빼서 연산 후 결과 값 다시 넣음
		if (inputStrS[i] == '+')
		{
			tmp1 = ans.top();
			ans.pop();
			tmp2 = ans.top();
			ans.pop();
			ans.push(tmp2 + tmp1);
		}
		else if (inputStrS[i] == '-')
		{
			tmp1 = ans.top();
			ans.pop();
			tmp2 = ans.top();
			ans.pop();
			ans.push(tmp2 - tmp1);
		}
		else if (inputStrS[i] == '/')
		{
			tmp1 = ans.top();
			ans.pop();
			tmp2 = ans.top();
			ans.pop();
			ans.push(tmp2/tmp1);
		}
		else if (inputStrS[i] == '*')
		{
			tmp1 = ans.top();
			ans.pop();
			tmp2 = ans.top();
			ans.pop();
			ans.push(tmp1*tmp2);
		}
		//값이 숫자라면 스택에 푸시
		else {
			ans.push(inputArr[inputStrS[i]]);
		}
	}
	//소수점 몇번째 자리인지 고정시킨 후
	cout<<fixed;
	//소수점 밑 둘째자리까지 표시
	cout.precision(2);
	//반복문 빠져나왔다면 결과값만 남아있을 것이므로 
	cout << ans.top();
}
int main() {
	input();
	solution();
}
소수점 몇째 자리까지 고정시키는 방법이 안 떠올라서 검색을 좀 했던 문제다.
정리해놔야겠다.