Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(void) {
- int N, R, max, m2, m7, m14, i, num, result;
- max = 0; m2 = 0; m7 = 0; m14 = 0;
- scanf("%d", &N);
- for(i = 0; i < N; i++) {
- scanf("%d", &num);
- if(num % 2 == 0 && num % 7 != 0 && num > m2)
- m2 = num;
- if(num % 2 != 0 && num % 7 == 0 && num > m7)
- m7 = num;
- if(num % 14 == 0 && num > m14)
- m14 = num;
- if(num > max)
- max = num;
- }
- scanf("%d", &R);
- if(m2*m7 < m14*max)
- result = m14*max;
- else
- result = m2*m7;
- printf("Calculated value: %d\n", result);
- if(R == result)
- printf("Success");
- else
- printf("Incorrect");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement