Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- import java.io.*;
- class arrayupdate
- {
- public static void main()throws IOException
- {
- try
- {
- Scanner sc=new Scanner(System.in);
- int n=sc.nextInt();
- int arr[]=new int[n];
- int sum=0;
- for(int x=0;x<n;x++)
- {
- arr[x]=sc.nextInt();
- sum+=arr[x];
- }
- int div=(int)sum/n;
- div+=1;
- System.out.println(div);
- }
- catch(Exception e)
- {
- System.out.println("ERROR");
- }
- }
- }
Add Comment
Please, Sign In to add comment