Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int broj_na_deliteli_na_x(int x, int i) {
- if(i > x) {
- return 0;
- }
- int delitel = 0;
- if(x % i == 0) {
- delitel = 1;
- }
- return broj_na_deliteli_na_x(x, i + 1) + delitel;
- }
- int main() {
- printf("%d\n", broj_na_deliteli_na_x(10, 1));
- }
- // broj_na_deliteli_na_x(10, 1) --> broj_na_deliteli_na_x(10, 2) + 1
- // broj_na_deliteli_na_x(10, 2) --> broj_na_deliteli_na_x(10, 3) + 1
- // broj_na_deliteli_na_x(10, 3) --> broj_na_deliteli_na_x(10, 4) + 0
- // broj_na_deliteli_na_x(10, 4) --> broj_na_deliteli_na_x(10, 5) + 0
- // broj_na_deliteli_na_x(10, 5)....
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement