Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <cmath>
- #include <map>
- #include <string>
- using namespace std;
- int something() {
- string str;
- int k,temp,sum=0;
- cin >> str;
- char symbolV;
- k = sizeof(str);
- map<char, int> symbol;
- symbol['I'] = 1;
- symbol['V'] = 5;
- symbol['X'] = 10;
- symbol['L'] = 50;
- symbol['C'] = 100;
- symbol['D'] = 500;
- symbol['M'] = 1000;
- for (int i = 0; i < k - 1; i++) {
- symbolV = str[i];
- if (str[i] < str[i + 1]) {
- temp = str[i + 1] - str[i];
- }
- sum += str[i];
- cout << sum << endl;
- }
- }
- int main() {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement