|
|
back to boardJava Ans. Posted by koti4 24 Feb 2021 14:26 import java.util.*; public class j { public static void main(String[] args){ Scanner input = new Scanner(System.in); int bin,sum = 0; int n=input.nextInt(); int m=input.nextInt(); int [] mas = new int [n]; for(int i = 0;i<m;i++){ bin = input.nextInt(); sum += 1; mas[bin-1] = mas[bin-1] + 1; } for(int i = 0;i<n;i++){ System.out.println(String.format("%.2f",mas[i]/(sum*0.01))+"%"); } } } |
|
|