Advertisement
Guest User

project

a guest
Apr 26th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. #include<iostream>
  2. #include<string>
  3. using namespace std;
  4.  
  5.  
  6.  
  7. int main()
  8. {
  9.     string input, x_array[1000], y_array[1000];
  10.     int indx_x = 0, indx_y = 0, x = 0, l;
  11.     cin >> input;
  12.     l = input.length();
  13.     for (int i = 0; i < l; i++)
  14.     {
  15.         if (input[i] == ',')
  16.         {
  17.             for (int j = 0; j < i; j++)
  18.             {
  19.                 if (input[j] == '(')
  20.                 {
  21.                     x_array[indx_x] = input[i - j];
  22.                     indx_x++;
  23.                 }
  24.             }
  25.  
  26.                 for (int k = 0; k < l; k++)
  27.                 {
  28.                     if (input[k] == ')')
  29.                     {
  30.                         y_array[indx_y] = input[k - i];
  31.                         indx_y++;
  32.                     }
  33.                 }
  34.         }
  35.  
  36.         cout << x_array << endl << y_array << endl;
  37.  
  38.         return 0;
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement