作者:yunjinqi 类别:
日期:2023-06-04 19:08:19
阅读:419 次 消耗积分:0 分
#include <stdio.h>
int main(){
int a,b,n;
int result;
int arr[1000]={0};
int count=0;
int v1,v2;
int index=0;
if (scanf("%d %d %d",&a,&b,&n)!=EOF){
if (n==1){arr[0] = a;}
if (n==2){arr[0] = a;arr[1] = b;}
if (n>2){
while (count<n){
if (count==0){arr[count] = a;count++;}
if (count==1){arr[count] = b;count++;}
if (count<n){
result = a*b;
if (result>9){
v1 = result/10;
v2 = result%10;
arr[count] = v1;
arr[count+1] = v2;
count+=2;
}
else{
arr[count]=result;
count+=1;
}
index++;
a = arr[index];
b = arr[index+1];
}
}
}
}
// 打印数据
for (int i=0;i<n;i++){
printf("%d",arr[i]);
if (i!=n-1){printf(" ");}
}
return 0;
}