Advertisement
Naimul_X

Untitled

May 21st, 2020
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1.  
  2. package oop_191Final;
  3.  
  4.  
  5. import java.io.BufferedReader;
  6. import java.io.FileReader;
  7. import oop_191Final.C.D;
  8.  
  9.  
  10. public class Question2 {
  11. public static void main(String[] args) throws Exception{
  12. BufferedReader br =new BufferedReader (new FileReader("D:\\OOP1\\src\\oop_191Final\\numbers.txt"));
  13.  
  14. String s=br.readLine();
  15.  
  16. while(s!=null)
  17. {
  18. String[] string=s.split(",");/// 40,60,70
  19.  
  20. int[] a=new int[string.length];
  21.  
  22. for(int i=0;i<a.length;i++)
  23. {
  24. a[i]=Integer.parseInt(string[i]);
  25. }
  26. int max=0;
  27. for(int i=0;i<a.length;i++)
  28. {
  29. if(max<a[i])
  30. {
  31. max=a[i];
  32. }
  33. }
  34. System.out.println(max);
  35. s=br.readLine();
  36. }
  37.  
  38.  
  39.  
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement