Friday, February 1, 2019

COUNT IT

  • Problem Description

    Write a program to get the inputs from the user and display the count element

    Input 
    1. The number of inputs
    2. The input elements
    3. The element to be counted

    Output:
    Total Count of numbers (Input step 3)
  • CODING ARENA
  • a=int(input())
    count=0
    for i in range(a):
        b=int(input())
        if(b%a==0):
            count+=1
    print("Count=",count)
  • Test Case 1

    Input (stdin)
    7
    
    12
    
    13
    
    14
    
    14
    
    14
    
    15
    
    16
    
    14
    
    
    Expected Output
    Count= 3
  • Test Case 2

    Input (stdin)
    7
    
    12
    
    13
    
    14
    
    16
    
    14
    
    15
    
    16
    
    16
    
    
    Expected Output
    Count= 2

No comments:

Post a Comment