Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<string>
- using namespace std;
- int main()
- {
- string input, x_array[1000], y_array[1000];
- int indx_x = 0, indx_y = 0, x = 0, l;
- cin >> input;
- l = input.length();
- for (int i = 0; i < l; i++)
- {
- if (input[i] == ',')
- {
- for (int j = 0; j < i; j++)
- {
- if (input[j] == '(')
- {
- x_array[indx_x] = input[i - j];
- indx_x++;
- }
- }
- for (int k = 0; k < l; k++)
- {
- if (input[k] == ')')
- {
- y_array[indx_y] = input[k - i];
- indx_y++;
- }
- }
- }
- cout << x_array << endl << y_array << endl;
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement