#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
相关推荐
hPw0eKIqD6 小时前
C++ 模板参数推导问题小记(非推导上下文)程序员爱德华7 小时前
Python与C++:异同点对比普通攻击往后拉7 小时前
Leetcode 206. 反转链表@syh.8 小时前
【贪心】矩阵消除游戏可编程芯片开发8 小时前
基于零极点配置的PID控制系统simulink建模与仿真徐小夕9 小时前
开源!我用SQLite + DuckDB打造了一款可视化AI问数平台Hrain-AI9 小时前
2026 企业 AI 智能体平台横评:8 大主流平台 7 维度实测对比Angel Q.10 小时前
因子分析和生成模型有什么关系?从“幕后因素”到“生成数据”888CC++10 小时前
C语言与C++的区别:从面向过程到面向对象