Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NU ESTE REZOLVATA ERAORE EROARE
- #include <iostream>
- #include <fstream>
- using namespace std;
- ifstream F("Citire.in");
- int A[100];
- void CitireVector(A[],N);
- {
- f>>N;
- for(int i=1;i<=N;i++)
- f>>A[i];
- }
- int SumaDivide(int s , int d)
- {
- if(s==d)
- return A[s];
- else
- {
- int mij=(s+d)/2;
- return SumaDivide(s,mij)+SumaDivide(mij+1,d);
- }
- }
- int main(void)
- {
- int N,mij,s,d;
- // CitireVector(A,N);
- /* cin>>N;
- for(int i=1;i<=N;i++)
- {
- cin>>A[i];
- }*/
- cout<<endl;
- cout<<"Suma este: "<<SumaDivide(s,d);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement