SHARE
TWEET

Untitled

a guest Nov 19th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int yra1 = 0, yra2 = 0, yra3 = 0;
  8.     string A, B, C, A1, B1, C1;
  9.     cin >> A >> B >> C;
  10.     A1 = A;
  11.     B1 = B;
  12.     C1 = C;
  13.     for (int i = 0; i < A.size(); i++) {
  14.         for (int j = 0; j < B.size(); j++) {
  15.             for (int k = 0; k < C.size(); k++) {
  16.                 if (A[i] == B[j] && A[i] != C[k] && A[i] != '_' && B[j] != '_' && (yra1 == 0 || yra2 == 0)) {
  17.                     A[i] = '_';
  18.                     B[j] = '_';
  19.                     yra1 = 1;
  20.                     yra2 = 1;
  21.                     cout << A1 << " " << i + 1 << " " << B1 << " " << j + 1 << endl;
  22.                 }
  23.                 if (A[i] == C[k] && A[i] != B[j] && A[i] != '_' && C[k] != '_' && (yra1 == 0 || yra3 == 0)) {
  24.                     A[i] = '_';
  25.                     C[k] = '_';
  26.                     yra1 = 1;
  27.                     yra3 = 1;
  28.                     cout << A1 << " " << i + 1 << " " << C1 << " " << k + 1 << endl;
  29.                 }
  30.                 if (B[j] == C[k] && B[j] != A[k] && B[j] != '_' && C[k] != '_' && (yra2 == 0 || yra3 == 0)) {
  31.                     B[j] = '_';
  32.                     C[k] = '_';
  33.                     yra2 = 1;
  34.                     yra3 = 1;
  35.                     cout << B1 << " " << j + 1 << " " << C1 << " " << k + 1 << endl;
  36.                 }
  37.             }
  38.         }
  39.     }
  40. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top