Advertisement
Spocoman

05. Challenge the Wedding

Sep 12th, 2023
727
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     int menCount, womenCount, tables;
  7.     cin >> menCount >> womenCount >> tables;
  8.  
  9.     for (int i = 1; i <= menCount; i++) {
  10.         for (int k = 1; k <= womenCount; k++) {
  11.             if (tables == 0) {
  12.                 break;
  13.             }
  14.  
  15.             cout << "(" << i << " <-> " << k << ") ";
  16.             tables--;
  17.         }
  18.     }
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement