daily pastebin goal
58%
SHARE
TWEET

Untitled

a guest Dec 11th, 2017 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <string>
  3. #include <cstdlib>
  4. #include <vector>
  5.  
  6. using namespace std;
  7.  
  8. int main() {
  9.     vector <int> M, N;
  10.     string input, open = "[", close = "]", dot = ",", tmp = "";
  11.     cin >> input;
  12.     int temp;
  13.     for (int i = 2; i < input.size(); ++i) {
  14.         if(input[i] == open[0]){
  15.             temp = i+1;
  16.             break;
  17.         }
  18.         if(input[i] != dot[0]){
  19.             tmp += input[i];
  20.         }
  21.         else{
  22.             M.push_back(atoi(tmp));
  23.             tmp = " ";
  24.         }
  25.     }
  26.     tmp = " ";
  27.     for (int i = temp; i < input.size(); ++i) {
  28.         if(input[i] == close[0]){
  29.             break;
  30.         }
  31.         if(input[i] != dot[0]){
  32.             tmp += input[i];
  33.         }
  34.         else{
  35.             N.push_back(atoi(tmp));
  36.             tmp = " ";
  37.         }
  38.     }
  39.  
  40.  
  41.     return 0;
  42. }
RAW Paste Data
Top