如何移动数据?
#include "stdafx.h"#include "stdio.h"
#include "math.h"
int main(int argc, char* argv[])
{
int a[10]={78,56,89,91,48,68,73,85,76,70};如何将78,56,89,91,48,68,73,85,76,70移动为 89,91,48,68,73,85,76,70,78,56?
int a0=a[9];
int a1=a[8];
int i=0;
for(i=0;i<10;i++)
{
printf("%4d",a[i]);
}
printf("\n");
for(i=9;i>=0;i--)
a[i]=a[i-1];
a[0]=a0;
a[1]=a1;
for(i=0;i<10;i++)
{
printf("%4d",a[i]);
}
printf("\n");
return 0;
}