C语言到Java的代码转换,难!!!
#include "stdio.h"
void _copy(int *to, int *from, int count)
{
int n=(count+7)/8;
switch (count%8)
{
case 0:
do { *to++ = *from++;
case 8: *to++ = *from++;
case 7: *to++ = *from++;
case 6: *to++ = *from++;
case 5: *to++ = *from++;
case 4: *to++ = *from++;
case 3: *to++ = *from++;
case 2: *to++ = *from++;
case 1: *to++ = *from++;
} while (--n > 0);
}
}
void main()
{
int a[10] = { 0,1,2,3,4,5,6,7,8,9 };
int b[10] = { 9,8,7,6,5,4,3,2,1,0 };
_copy(b,a,10);
for(int i=0;i<10;i++)
printf("%d\n",b[i]);
}