|
|
back to boardцуп Posted by PULSAR 19 Nov 2017 19:00 import java.util.Scanner; public class cc { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int x=0; int y = 0; int n = sc.nextInt(); int[]mas=new int[n]; for (int i = 0;i<n;i++) { mas[i] = sc.nextInt(); } for (int t = n-1;t>0;t--) { for (int j = 0;j<t;j++) { if (mas[j]>mas[j+1]) { int h = mas[j]; mas[j]=mas[j+1]; mas[j+1]=h; } } } x=n/2+1; for (int p = 0;p<x;p++) { y=y+mas[p]/2+1; } System.out.print(y); } } Re: цуп Posted by Bart11 19 Nov 2017 19:02 Krasafchic) Edited by author 19.11.2017 19:03 Re: цуп Posted by Bart11 19 Nov 2017 19:03 Krasafchic) Re: цуп Posted by Bart11 19 Nov 2017 19:04 молодец |
|
|