Open pangfengliu opened 10 years ago
int main(void) { int number; int value, printed_value; scanf("%d", &number); value = ( number % 3 ) == 0 && ( number % 5 ) == 0 && ( number % 7 ) != 0 ; printed_value = !value; printf("%d", printed_value); return 0; }
main() { int x; scanf("%d", &x); if ((x % 15 == 0) && (x % 7 != 0)) printf("%d",0); else printf("%d", 1); return 0; }
Task Description
Write a program to print 0 if the input x is a multiple of 3, and a multiple of 5, but not a multiple of 7. Otherwise just print 1.
Input Format
There is one line in the input. The line has a number x.
Output Format
There is one line in the output. The line has 0 if the input x is a multiple of 3, and a multiple of 5, but not a multiple of 7. Otherwise the output is 1.
Sample Input
15
Sample Output
0
Sample Input
105
Sample Output
1
Test Data
You can download the test data (which JudgeGirl uses) from here.