Advertisement
unknown_0711

Untitled

Nov 16th, 2022
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4. public class Main{
  5. public static void main(String[] args)
  6. {
  7. Scanner sc=new Scanner(System.in);
  8. String ip=sc.nextLine();
  9. int max_element=0;
  10. int temp=0;
  11. for(int i=0;i<ip.length();i++)
  12. if(ip.charAt(i)!=' ')
  13. {
  14. int digit=(ip.charAt(i)-'0');
  15. temp=temp*10+digit;
  16. } else
  17. {
  18. if(temp>max_element)
  19. {
  20. max_element=temp;
  21. }
  22. temp=0;
  23. }
  24. }
  25. if(temp>max_element) {
  26. max_element=temp;
  27. }
  28. System.out.println(max_element);
  29. return ;
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement