[Mảng 1 Chiều Cơ Bản]. Bài 19. Lật ngược mảng

View as PDF

Submit solution

Points: 1.00 (partial)
Time limit: 1.0s
Memory limit: 256M
Input: stdin
Output: stdout

Problem source:
28Tech
Problem type
Allowed languages
C, C#, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch

Cho mảng số nguyên A[] gồm N phần tử, hãy lật ngược mảng A[] và in ra kết quả


Đầu vào

Dòng đầu tiên là số nguyên dương N

Dòng thứ 2 gồm N số nguyên viết cách nhau một vài khoảng trắng


Giới hạn

1<=N<=1000

-10^3<=A[i]<=10^3


Đầu ra

In ra mảng sau khi đã đảo ngược các phần tử


Ví dụ :

Input 01
5
1 2 3 4 5
Output 01
5 4 3 2 1

Comments

Please read the guidelines before commenting.



  • 0
    tranquamuop  commented on Nov. 15, 2024, 8:05 a.m.

    include <bits/stdc++.h>

    using namespace std;

    int main() {

    int n,a[10005],i; cin>>n; for(i=1;i<=n;i++) cin>>a[i]; for(i=n;i>=1;i--) cout<<a[i]<<" "; return 0; } strong text


  • -19
    huynt  commented on June 7, 2024, 3:31 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -15
    phao_245  commented on May 27, 2024, 4:33 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.