Lucky 7
Time limit5sMemory limit1024 MB
Given an integer, the task is to print 0, 1, 2, or 3 depending on whether the number contains digit 7 and whether it is divisible by 7.
- Level
Easy1 of 10
- Topics
- Math, String, Implementation
- Solved
- No attempts yet
Problem
Fact or Fiction, some people consider 7 to be a lucky digit or number.
Given a number, determine how lucky it is by printing one of four values:
- Print 0 if the number does not contain 7 and is not divisible by 7.
- Print 1 if the number does not contain 7 but is divisible by 7.
- Print 2 if the number contains 7 but is not divisible by 7.
- Print 3 if the number contains 7 and is divisible by 7.
Input
There is only one input line, containing one integer between 1 and , inclusive.
Output
Print one of the four messages as described above.