[YTU]_1046 ( 输入10个数字,然后逆序输出)

Description

输入10个数字,然后逆序输出。

Input

十个整数

Output

逆序输出,空格分开

Sample Input

1 2 3 4 5 6 7 8 9 0

Sample Output

0 9 8 7 6 5 4 3 2 1
#include <iostream> 
using namespace std; 
void revert(int*p,int n) 
{ 
    int i; 
    for(i=n-1;i>=1;i--) 
        cout<<p[i]<<' ';
        cout<<p[i];
    cout<<endl; 
} 
int main()
{
    void revert(int *,int);
    const int N=10;
    int a[N],i;
    for(i=0; i<N; i++)
        cin>>a[i];
    revert(a,N);
    return 0;
}

posted @ 2017-06-04 14:23  衣带渐宽、为伊憔悴  阅读(488)  评论(0编辑  收藏  举报