Created
February 18, 2018 11:49
-
-
Save ayyucedemirbas/82d6500fdca64fddfe52c6cb2c755f39 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.io.*; | |
| import java.util.*; | |
| public class java_notu { | |
| public static void main(String[] args) throws FileNotFoundException{ | |
| File f= new File("/home/ayyuce/Desktop/java.txt"); | |
| Scanner sc= new Scanner(f); | |
| String substr="", tmp="", str=""; | |
| int[] arr= new int[3]; | |
| int max= arr[0]; | |
| int i, index; | |
| for(i=0; i<3;i++){ | |
| str=sc.nextLine(); | |
| index=str.indexOf(" "); | |
| tmp=str.substring(index+1); | |
| index=tmp.indexOf(" "); | |
| substr=tmp.substring(index+1); | |
| arr[i]=Integer.parseInt(substr); | |
| if(arr[i]> max){ | |
| max=arr[i]; | |
| } | |
| } | |
| System.out.println(max); | |
| sc.close(); | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment