1.8559
#include <stdio.h>
int main()
{
int n;
int x;
scanf("%d",&n);
int a[1000];
for(int i=1;i<=n;i++)
{
scanf("%d",&a[i]);
printf("%d ",a[i]);
}
printf("\n");
for(int i=1;i<=n/2;i++)
{
x=a[i];
a[i]=a[n-i+1];
a[n-i+1]=x;
}
for(int i=1;i<=n;i++)
{
printf("%d ",a[i]);
}
return 0;
}
2.8553
#include <stdio.h>
#include <stdlib.h>
typedef struct node{
int data;
struct node *next;
}LNode;
int main()
{
LNode *h,*r;
h=(LNode *)malloc(sizeof(LNode));
h->next=NULL;
r=h;
int n;
while(scanf("%d",&n))
{
if(n==0) break;
LNode *p;
p=(LNode *)malloc(sizeof(LNode));
p->data=n;
p->next=r->next;
r->next=p;
r=p;
}
LNode *p;
p=h->next;
while(p!=NULL){
printf("%d ",p->data);
p=p->next;
}
return 0;
}
3.8554
#include <bits/stdc++.h>
using namespace std;
typedef struct node{
int data;
struct node *next;
}LNode,*LList;
void CREAT(LNode* &h){
LList p,r;
h=(LNode *)malloc(sizeof(LNode));
h->next=NULL;
r=h;
int n;
while(cin>>n){
if(n==0) break;
p=(LNode *)malloc(sizeof(LNode));
p->data=n;
p->next=r->next