育婴室(wa!)
查看原帖
育婴室(wa!)
1321274
Zivsfamily楼主2024/7/24 20:17
#include<bits/stdc++.h>
using namespace std;
int n;
string a;
void dfs(int w/*总数*/,int x/*第几个数*/,int y/*那个数*/,int z/*执行多少次了*/){
	if(z>n){
		if(w==n){
			for(int i=1;i<x;i++){
			//	printf("%d",a[i]);
			}
	//		printf("\n");
		}
		return;
	}
	
	cout << y;
	a[x+1]='1'+y-1;
	cout << a[x+1];
	exit(0);
	a[x+2]='+';
	dfs(w+y,x+2,y,z+1);
	dfs(w+y,x+2,y+1,z+1);
	dfs(w,x,y+1,z+1);
}
int main(){
	cout << "1+1";
	exit(0);
	scanf("%d",&n);
	dfs(0,1,1,1);
	return 0;
} ```只见WA声一片
2024/7/24 20:17
加载中...