#include<bits/stdc++.h>
using namespace std;
int n,ans;
int main(){
cin>>n;
for(int a=1;a<=3;a++){
for(int b=1;b<=3;b++){
for(int c=1;c<=3;c++){
for(int d=1; d<=3; d++){
for(int e=1; e<=3; e++){
for(int f=1; f<=3; f++){
for(int g=1; g<=3; g++){
for(int h=1; h<=3; h++){
for(int r=1; r<=3; r++){
for(int w=1; w<=3; w++){
if(a+b+c+d+e+f+g+h+r+w==n){
ans++;
}
}
}
}
}
}
}
}
}
}
}
for(int a=1;a<=3;a++){
for(int b=1;b<=3;b++){
for(int c=1;c<=3;c++){
for(int d=1; d<=3; d++){
for(int e=1; e<=3; e++){
for(int f=1; f<=3; f++){
for(int g=1; g<=3; g++){
for(int h=1; h<=3; h++){
for(int r=1; r<=3; r++){
for(int w=1; w<=3; w++){
if(a+b+c+d+e+f+g+h+r+w==n){
cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<" "<<f<<" "<<g<<" "<<h<<" "<<r<<" "<<w<<" "<<endl;
}
}
}
}
}
}
}
}
}
}
}
return 0;
}
P2089 烤鸡
C++chaofan2025-05-25 18:05
相关推荐
多弗朗皮卡丘15 分钟前
C++STL之空间配置器牵猫散步的鱼儿20 分钟前
Demosaic 和 Remosaic荆棘鸟智能23 分钟前
河道采砂船识别与轨迹追踪怎么做?检测、跟踪与电子围栏实战思路CodeYp201927 分钟前
第19讲:封装红黑树实现 mymap 和 myset揽星河..1 小时前
【初阶数据结构】常见的排序算法DFT计算杂谈1 小时前
GSAS-II X 射线衍射(XRD)数据转换为对分布函数(PDF,Pair Distribution Function)孙鹏宇.1 小时前
C++类型转换绕灵儿1 小时前
火灾检测-应用场景-YOLO训练记录超级架构师1 小时前
让 COBOL 长出 AI 大脑:原生 Agent 核心框架 praxo-core 深度剖析·present·1 小时前
CSAPP(lecture 10)