Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class ChallengeTheWedding {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int men = Integer.parseInt(scanner.nextLine()),
- women = Integer.parseInt(scanner.nextLine()),
- tables = Integer.parseInt(scanner.nextLine());
- for (int i = 1; i <= men; i++) {
- for (int k = 1; k <= women; k++) {
- if (tables == 0) {
- break;
- }
- System.out.printf("(%d <-> %d) ", i, k);
- tables--;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement