Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main()
- {
- int a[50],n,x;
- beolvas(a,n,x);
- if (divide_et_impera(a,1,n,x))
- cout<<"korrekt";
- else
- cout<<"nem korrekt";
- return 0;
- }
- [9:13 PM]
- #include <iostream>
- using namespace std;
- int divide_et_impera(int a,int e,int v)
- {
- if (e==v)
- return a;
- int kozep=(e+v)/2;
- int f1=divide_et_impera(a,e,kozep);
- int f2=divide_et_impera(a,kozep+1,v);
- return f1*f2;
- }
- int main()
- {
- int a,n;
- cin>>a>>n;
- cout<<divide_et_impera(a,1,n);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement