Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- int sumaParoviCifriPodogolemiOd(int n,int broj)
- {
- if(n==0)
- return 0;
- else{
- int par=n%100;
- if(par<=broj)
- {
- return sumaParoviCifriPodogolemiOd(n/100,broj);
- }
- else{
- return par+sumaParoviCifriPodogolemiOd(n/100,broj);
- }
- }
- }
- int main()
- {
- int n;
- int broj;
- scanf("%d%d",&n,&broj);
- printf("%d", sumaParoviCifriPodogolemiOd(n,broj));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment