Algorithm


 problem Link :  https://www.codechef.com/problems/PRACTICEPERF 

Problem

Most programmers will tell you that one of the ways to improve your performance in competitive programming is to practice a lot of problems.

Our Chef took the above advice very seriously and decided to set a target for himself.

  • Chef decides to solve at least 10 problems every week for 4 weeks.

Given the number of problems he actually solved in each week over 4 weeks as �1,�2,�3, and �4, output the number of weeks in which Chef met his target.

Input Format

There is a single line of input, with 4 integers �1,�2,�3, and �4. These are the number of problems solved by Chef in each of the 4 weeks.

Output Format

Output a single integer in a single line - the number of weeks in which Chef solved at least 10 problems.

Constraints

  • 1≤�1,�2,�3,�4≤100

Sample 1:

Input
 
Output
 
12 15 8 10
3

Explanation:

Chef solved at least 10 problems in the first, second and fourth weeks. He failed to solve at least 10 problems in the third week. Hence, the number of weeks in which Chef met his target is 3.

Code Examples

#1 Code Example with C Programming

Code - C Programming

 #include<stdio.h>
int main()
{
    int i,w[4],count=0;
    for(i=0;i < 4;i++)
    {
        scanf("%d",&w[i]);
        if(w[i]>=10) count++;
    }
    printf("%d",count);
} 
Copy The Code & Try With Live Editor

Input

x
+
cmd
12 15 8 10

Output

x
+
cmd
3
Advertisements

Demonstration


CodeChef solution in PRACTICEPERF  - Practice makes us perfect Codechef solution  in C,C++

Previous
CodeChef solution FLOW004 - ,First and Last Digit CodeChef solution in C,C++
Next
CodeChef solution in INCRIQ - Increase IQ Codechef solution in C,C++