Advertisement
andreim618

Untitled

May 27th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int n,x[201],y[201],S;
  6.  
  7. int main()
  8. {
  9.  
  10.     cin >> n;
  11.  
  12.     for(int i=1;i<=n;i++)
  13.     {
  14.         cin >> x[i];
  15.         S+=x[i];
  16.     }
  17.  
  18.     for(int i=1;i<=n;i++)
  19.         y[i]=S-x[i];
  20.  
  21.     for(int i=1;i<=n;i++)
  22.         cout << y[i] << " ";
  23.  
  24.     return 0;
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement