Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Matrix {
- public static void main(String[] args) {
- try{
- BufferedReader rd = new BufferedReader(new InputStreamReader(System.in));
- int n = Integer.parseInt(rd.readLine());
- ...
- swapStrings(a,100000,2);
- }
- catch(NumberFormatException e){
- System.out.println("n - is not int! Exit");
- }
- catch (IllegalArgumentException illegalEx) {
- System.out.println(illegalEx.getMessage());
- }
- }
- static void swap(int[][] a, int first, int second){
- if(first < second && second < a.length){
- ...
- }
- }
- else{
- throw new IllegalArgumentException("Error while swapping - incorrect input values!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement