#include<bits/stdc++.h>
using namespace std;
int calc(int ar[],int m,int n)
{
if(n==0)
return 1;
if(n<0)
return 0;
if(m<=0 &&n>=1)
return 0;
return calc(ar,m-1,n)+calc(ar,m,n-ar[m-1]);
}
main()
{
int ar[]={1,2,3};
int size=3;
int sum=4;
int count;
count=calc(ar,size,sum);
cout<<count;
}
using namespace std;
int calc(int ar[],int m,int n)
{
if(n==0)
return 1;
if(n<0)
return 0;
if(m<=0 &&n>=1)
return 0;
return calc(ar,m-1,n)+calc(ar,m,n-ar[m-1]);
}
main()
{
int ar[]={1,2,3};
int size=3;
int sum=4;
int count;
count=calc(ar,size,sum);
cout<<count;
}
What a fantastic and informative blog! i enjoyed reading this, and I must say your blog is great! Keep up the excellent work. You have a magical talent of holding readers mind.
ReplyDeletethank you..
DeleteIf you are a job seeker, Career Circular is the best website for you. We collect many BD job circular and posting here. You can easily find your dream job.
ReplyDeleteLatest Gov Jobs
Latest Job News
BD Job Circular
Prothom Alo Jobs
Latest Job Circular
Forex Signals, MT4 and MT5 Indicators, Strategies, Expert Advisors, Forex News, Technical Analysis and Trade Updates in the FOREX IN WORLD
ReplyDeleteForex Signals Forex Strategies Forex Indicators Forex News Forex World
Shield Security Solutions Offers Security Guard License Training across the province of Ontario. Get Started Today!
ReplyDeleteSecurity Guard License | Security License | Ontario Security license | Security License Ontario | Ontario Security Guard License | Security Guard License Ontario