Advertisement
Guest User

Untitled

a guest
Oct 7th, 2015
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int n,m,p;
  5. float a[51],b[51],c[51];
  6. void citire()
  7. {
  8. ifstream f("pol.in");
  9. f>>n>>m;
  10. for(int i=0;i<=n;i++)
  11. f>>a[i];
  12. for(int i=0;i<=m;i++)
  13. f>>b[i];
  14.  
  15. }
  16. void suma()
  17. {
  18.  
  19. if(n>m)
  20. p=n;
  21. else
  22. p=m;
  23. for(int i=0;i<=p;i++)
  24. c[i]=a[i]+b[i];
  25. }
  26.  
  27. void afisare()
  28. {
  29. ofstream g("po.out");
  30. g<<p<<endl;
  31. for(i=0;i<=p;i++)
  32. g<<fixed<<setprecision(2)<<c[i]<<" ";
  33. }
  34.  
  35. int main()
  36. {
  37.  
  38. return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement