Skip to content

Instantly share code, notes, and snippets.

@ayyucedemirbas
Created February 18, 2018 11:49
Show Gist options
  • Save ayyucedemirbas/82d6500fdca64fddfe52c6cb2c755f39 to your computer and use it in GitHub Desktop.
Save ayyucedemirbas/82d6500fdca64fddfe52c6cb2c755f39 to your computer and use it in GitHub Desktop.
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