其他分享
首页 > 其他分享> > Symmetric Order

Symmetric Order

作者:互联网

#include<stdio.h>
int main()
{
    int n,i,set=1;
    char str[16][26];
    while(scanf("%d",&n)&&n!=0)
    {
        for(i=1;i<=n;i++)
        {
            scanf("%s",&str[i]);
        }
        printf("SET %d\n",set);
        set++;
        if(n%2==0)
        {
            for(i=1;i<=n;)
            {
                printf("%s\n",str[i]);
                i=i+2;
            }
            for(i=n;i>0;)
            {
                printf("%s\n",str[i]);
                i=i-2;
            }
        }
        else
        {
            for(i=1;i<=n;)
            {
                printf("%s\n",str[i]);
                i=i+2;
            } 
            for(i=n-1;i>0;)
            {
                printf("%s\n",str[i]);
                i=i-2;
            }
        }
    }
    return 0;
}

 

标签:char,int,i0,Symmetric,str,printf,main,Order
来源: https://www.cnblogs.com/zzjam--1/p/11391461.html