Confused!!!!!
Time Limit: 1 sec
The Problem
An integer n is said to be divisible by an integer b if n = bq for any integer q, where b is not equal to zero.
Example
12 is divisible by 3, because 12÷3 = 4 exactly
And 10 is divisible by 5, because 10÷5 = 2 exactly
And 14 is divisible by 7, because 14÷7 = 2 exactly
But 15 is not divisible by 7, because 15÷7 = 2 1/7
(i.e., the result is not an integer number)
Write a simple program that reads an integer number n, print “n is divisible by 3” if n is divisible by 3 or print “n is divisible by 5” if n is divisible by 5 or print “n is divisible by 7” if n is divisible by 7 otherwise print “Confused”.
The Input
There are several lines of input in the input file, and each line contains a positive integer n which is not greater than 100000. Input is terminated by EOF.
The Output
For each line of input, you have to print a line of output. If n is divisible by 3 then print “n is divisible by 3” and if n is divisible by 5 then print “n is divisible by 5” and if n is divisible by 7 then print “n is divisible by 7”, otherwise print “Confused” without quotes. Follow the sample input/output for exact format.
Sample Input
33
20
14
31
Sample Output
33 is divisible by 3
20 is divisible by 5
14 is divisible by 7
Confused
[College Level]
Inter School & College Programming Contest (ISCPC) 2015
Problem Setter: Shahin ShamS