Advertisement
Spocoman

Letters Combinations

Sep 20th, 2023 (edited)
772
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     char x, y ,z;
  7.     cin >> x >> y >> z;
  8.  
  9.     int counter = 0;
  10.  
  11.     for (int i = x; i <= y; i++) {
  12.         for (int k = x; k <= y; k++) {
  13.             for (int j = x; j <= y; j++) {
  14.                 if (i != z && k != z && j != z) {
  15.                     cout << (char)i << (char)k << (char)j << " ";
  16.                     counter++;
  17.                 }
  18.             }
  19.         }
  20.     }
  21.  
  22.     cout << counter << endl;
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement