Advertisement
Dilyana86

Untitled

Apr 26th, 2017
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class battles201116 {
  4. public static void main(String[] args) {
  5. Scanner scan = new Scanner(System.in);
  6. int firstCount = Integer.parseInt(scan.nextLine());
  7. int secondCount = Integer.parseInt(scan.nextLine());
  8. int max = Integer.parseInt(scan.nextLine());
  9. int counter = 0;
  10.  
  11. for(int i=1 ; i<=firstCount ; i++){
  12. for(int j=1 ; j<=secondCount ; j++){
  13. counter++;
  14. if (counter > max){
  15. break;
  16. }
  17. System.out.printf("(%d <-> %d) ",i,j);
  18. }
  19. }
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement