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