Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- int n = sc.nextInt(); // Broq na grupite ot katerachi. (n)
- int all = 0; // Vsichki katerachi. (all)
- int[] counts = new int[5];
- for (int i = 0; i < n; i++){
- int gm = sc.nextInt(); // Promenliva za broq na horata v grupata. (gm)
- if (gm<6) counts[0]+=gm;
- else if (gm<13) counts[1]+=gm;
- else if (gm<26) counts[2]+=gm;
- else if (gm<41) counts[3]+=gm;
- else counts[4]+=gm;
- all += gm;
- }
- System.out.format("musala - %10.2f%%%n", counts[0]*100.0/all);
- System.out.format("Monblan - %10.2f%%%n", counts[1]*100.0/all);
- System.out.format("Kilimanjaro - %10.2f%%%n", counts[2]*100.0/all);
- System.out.format("K2 - %10.2f%%%n", counts[3]*100.0/all);
- System.out.format("Everest - %10.2f%%%n", counts[4]*100.0/all);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement