c语言数组问题,,,,,,,,,,

#include
void main()
{
int i,j,m,n,a[20];
printf("input ge shu n:");
scanf("%d",&n);
printf("\n");
printf("input yi dong wei shu m:");
scanf("%d",&m);
printf("\n");
printf("input");
scanf("%d",a);
i=m;
if(n20)
{ printf("wrong");
}
else
for(i=m;i>0;i--)
{
printf("%d",a[n-i]);
}
for(j=0;j<=m+1;j++)
{
printf("%d",a[j]);
}
printf("\n");
}

题目描述:

有n个整数,使其前面各数顺序向后移m个位置,最后m个数变成最前面的m个数。

输入描述:

输入总数n(0~20的整数),后移位数m(m

输出描述:

移动后的数列。

样式输入:

8
3
1 2 3 4 5 6 7 8

样式输出:

6 7 8 1 2 3 4 5
请问哪里错了

代码差的太远,连循环读取数字的逻辑都没有
参考:http://blog.sina.com.cn/s/blog_534d9ac90100iscj.html