Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- import java.lang.*;
- import java.io.*;
- public class Main{
- public static void main(String[] args)
- {
- Scanner sc=new Scanner(System.in);
- String ip=sc.nextLine();
- int max_element=0;
- int temp=0;
- for(int i=0;i<ip.length();i++)
- if(ip.charAt(i)!=' ')
- {
- int digit=(ip.charAt(i)-'0');
- temp=temp*10+digit;
- } else
- {
- if(temp>max_element)
- {
- max_element=temp;
- }
- temp=0;
- }
- }
- if(temp>max_element) {
- max_element=temp;
- }
- System.out.println(max_element);
- return ;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement