Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- int n, a[100], sum = 0;
- cout << "Nhap n: "; cin >> n;
- for (int i = 0; i < n; i++) {
- cout << "Nhap a[" << i << "] = ";
- cin >> a[i];
- sum += a[i];
- }
- cout << "Tong cac phan tu: " << sum << '\n';
- cout << "Mang a in theo thu tu nguoc lai: ";
- for (int i = n - 1; i >= 0; i--) {
- cout << a[i] << ' ';
- }
- cout << '\n';
- return 0;
- }
Add Comment
Please, Sign In to add comment