Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. NU ESTE REZOLVATA ERAORE EROARE
  2. #include <iostream>
  3. #include <fstream>
  4. using namespace std;
  5. ifstream F("Citire.in");
  6.  
  7.  
  8. int A[100];
  9. void CitireVector(A[],N);
  10. {
  11. f>>N;
  12. for(int i=1;i<=N;i++)
  13. f>>A[i];
  14. }
  15.  
  16.  
  17. int SumaDivide(int s , int d)
  18. {
  19. if(s==d)
  20. return A[s];
  21. else
  22. {
  23. int mij=(s+d)/2;
  24. return SumaDivide(s,mij)+SumaDivide(mij+1,d);
  25. }
  26. }
  27.  
  28. int main(void)
  29. {
  30. int N,mij,s,d;
  31. // CitireVector(A,N);
  32. /* cin>>N;
  33. for(int i=1;i<=N;i++)
  34. {
  35. cin>>A[i];
  36. }*/
  37. cout<<endl;
  38. cout<<"Suma este: "<<SumaDivide(s,d);
  39. return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement