Skip to content

Instantly share code, notes, and snippets.

@ayyucedemirbas
Created February 27, 2018 13:10
Show Gist options
  • Save ayyucedemirbas/67dfe057b1c1993458c432ff1581705b to your computer and use it in GitHub Desktop.
Save ayyucedemirbas/67dfe057b1c1993458c432ff1581705b 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= 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);
/*index=str.indexOf(" ");
tmp=str.substring(0,index);
System.out.println(tmp);*/
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