#include <stdio.h> #define N 50 void sum(int n,int *pa) { int count, total,temp; *pa=3;*++pa=2; tota

2024-11-15 16:56:24
推荐回答(1个)
回答(1):

int n = 30;

int []arr = new int[n+1];
arr[0] = 3;
arr[1] = 2;

for(int i=2; i<=n;){
int flag = arr[i-1]*arr[i-2];
if(flag<10){
arr[i] = flag;
i++;
}else{
int a1 = (int) Math.floor(flag/10);
int a2 = flag -a1*10;
arr[i] = a1;
arr[i+1] = a2;
i=i+2;
}
}

for(int m=0; m System.out.print(arr[m]+" ");
}

3 2 6 1 2 2 4 8 3 2 6 1 2 2 4 8 3 2 6 1 2 2 4 8 3 2 6 1 2 2 4
不知道对不对。。呵呵