#include<stdio.h>
int main(){
int n;
int a[7];
for(int i = 1; i <= 6; i++)
scanf("%d",&a[i]);
scanf("%d",&n);
for(int i = 1; i <= 6; i++)
{
int t = a[i];
int count = 0;
for(int j = 6; j >=1; j--)
{
if(j!=a[i])//只有不等于初始时count+1
count++;
if(count==n){
a[i] = j;
break;
}
}
}
for(int i = 1; i <= 6; i++){
printf("%d",a[i]);
if(i<6) printf(" ");
}
return 0;
}
PTA.团体程序设计天梯赛-练习集---------- L1-085 试试手气
于 2023-03-22 17:04:38 首次发布