Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main() {
- int N;
- scanf("%d", &N);
- for(int i = N - 1; i >= 0; i--) {
- int zbir_na_deliteli = 0;
- for(int j = 1; j <= i; j++) {
- if(i % j == 0) {
- zbir_na_deliteli += j;
- }
- }
- if(zbir_na_deliteli % 3 == 0) {
- printf("%d\n", i);
- return 0;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement