Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int poseben_broj(int x) {
- int zbir = 0;
- for(int i = 1; i < x; i++) {
- if(x % i == 0) {
- zbir += i;
- }
- }
- if(zbir == x) {
- return 1;
- }
- else {
- return 0;
- }
- }
- int funkcija(int A, int B) {
- for(int i = A; i <= B; i++) {
- if(poseben_broj(i) == 1) {
- 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