Josif_tepe

Untitled

May 4th, 2026
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main() {
  4.    
  5.     int broj;
  6.     scanf("%d", &broj);
  7.    
  8.     int zbir = 0;
  9.     for(int i = 1; i <= broj; i++) {
  10.         if(broj % i == 0 && i % 2 == 0) {
  11.             zbir += i;
  12.         }
  13.     }
  14.    
  15.     printf("%d\n", zbir);
  16.     return 0;
  17. }
  18.  
  19.  
  20.  
Advertisement
Add Comment
Please, Sign In to add comment