|
|
вернуться в форумI do not know why I am wrong, Netbeans works OK, but can not be accepted I do not know why I am wrong, Netbeans works OK, but can not be accepted, below is my code. public class Main { public static void main(String[] args) { System.out.println("Addition of Two Numbers(a,b) the sum is c"); int a = Integer.parseInt(args[0]); int b = Integer.parseInt(args[1]); int c = a+b; System.out.println( "c="+c ); } } Re: I do not know why I am wrong, Netbeans works OK, but can not be accepted I do not know why I am wrong, Netbeans works OK, but can not be accepted, below is my code. public class Main { public static void main(String[] args) { System.out.println("Addition of Two Numbers(a,b) the sum is c"); // remove line int a = Integer.parseInt(args[0]);// use Scanner() to read numbers. Not console arguments. int b = Integer.parseInt(args[1]); int c = a+b; System.out.println( "c="+c );// your output must mutch with example's output. Just "System.out.println( c ); } } Re: I do not know why I am wrong, Netbeans works OK, but can not be accepted Dear Oleg Strekalovsky: Thank you so much for your help! Re: I do not know why I am wrong, Netbeans works OK, but can not be accepted Dear Oleg Strekalovsky: Due to your great help, my submission has finally been accepted. Thank you so much! Re: I do not know why I am wrong, Netbeans works OK, but can not be accepted |
|
|