Created
September 16, 2017 15:00
-
-
Save invatainfo/812a95d71a706bc2391e1640991adc45 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream.h> | |
void main() { | |
int n, a[100], s = 0, i; | |
cin >> n; | |
for (i = 1; i <= n; i++) { | |
cin >> a[i]; | |
s = s + a[i]; | |
} | |
for (i = n; i >= 1; i--) { | |
cout << s << " "; | |
s = s - a[i]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment