Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var n, number, p1, p2, p3 int
- fmt.Scanln(&n)
- for i := 1; i <= n; i++ {
- fmt.Scanln(&number)
- if number % 2 == 0 {
- p1++
- }
- if number % 3 == 0 {
- p2++
- }
- if number % 4 == 0 {
- p3++
- }
- }
- fmt.Printf("%.2f%%\n%.2f%%\n%.2f%%\n", 100 * float64(p1) / float64(n), 100 * float64(p2) / float64(n), 100 * float64(p3) / float64(n))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement