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);
- int najgolem_zbir_na_deliteli = 0, broj = 0;
- for(int i = 1; i < N; i++) {
- int zbir = 0;
- for(int j = 1; j < i; j++) {
- if(i % j == 0) {
- zbir += j;
- }
- }
- if(zbir > najgolem_zbir_na_deliteli) {
- najgolem_zbir_na_deliteli = zbir;
- broj = i;
- }
- }
- printf("%d\n", broj);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement