Advertisement
Guest User

Untitled

a guest
Jul 30th, 2014
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.78 KB | None | 0 0
  1. public class Matrix {
  2.     public static void main(String[] args) {
  3.         try{
  4.             BufferedReader rd = new BufferedReader(new InputStreamReader(System.in));
  5.             int n = Integer.parseInt(rd.readLine());
  6.             ...
  7.             swapStrings(a,100000,2);
  8.         }
  9.         catch(NumberFormatException e){
  10.             System.out.println("n - is not int! Exit");
  11.         }
  12.     catch (IllegalArgumentException illegalEx) {
  13.         System.out.println(illegalEx.getMessage());
  14.     }
  15.     }
  16.  
  17.    
  18.     static void swap(int[][] a, int first, int second){
  19.         if(first < second && second < a.length){
  20.             ...
  21.             }
  22.         }
  23.         else{
  24.             throw new IllegalArgumentException("Error while swapping - incorrect input values!");
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement