Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <cmath>
  3. #include <map>
  4. #include <string>
  5. using namespace std;
  6.  
  7. int something() {
  8.  
  9.     string str;
  10.     int k,temp,sum=0;
  11.     cin >> str;
  12.     char symbolV;
  13.     k = sizeof(str);
  14.     map<char, int> symbol;
  15.     symbol['I'] = 1;
  16.     symbol['V'] = 5;
  17.     symbol['X'] = 10;
  18.     symbol['L'] = 50;
  19.     symbol['C'] = 100;
  20.     symbol['D'] = 500;
  21.     symbol['M'] = 1000;
  22.  
  23.     for (int i = 0; i < k - 1; i++) {
  24.         symbolV = str[i];
  25.         if (str[i] < str[i + 1]) {
  26.             temp = str[i + 1] - str[i];
  27.         }
  28.         sum += str[i];
  29.         cout << sum << endl;
  30.     }
  31.  
  32.  
  33.    
  34. }
  35.  
  36. int main() {
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement