求调
查看原帖
求调
783336
Earth_Sky楼主2024/12/25 13:39

rt

#include<bits/stdc++.h>
using namespace std;
int n,m,k;
int main(){
	ios::sync_with_stdio(NULL);
	cin.tie(0);cout.tie(0);
	cin>>n>>m>>k;
	if(n==1||m==1||k==1){
		cout<<n*m*k<<endl;
		for(int i=1;i<=n;i++)
		for(int j=1;j<=m;j++)
		for(int l=1;l<=k;l++)
		cout<<i<<' '<<j<<' '<<k<<endl;
	}else{
		cout<<(k-1)*(n-1)+(k-1)*(m-1)+(n-1)*(m-1)+1<<endl;
		for(int i=1;i<n;i++)
		for(int j=1;j<k;j++)
		cout<<i<<" 1 "<<j<<endl;
		for(int i=2;i<=m;i++)
		for(int j=1;j<k;j++)
		cout<<n<<' '<<i<<' '<<j<<endl;
		for(int i=1;i<=n-1;i++)
		for(int j=2;j<=m;j++)
		cout<<i<<' '<<j<<' '<<k<<endl;
		cout<<n<<" 1 "<<k<<endl;
	}

	return 0;
}

有没有大佬帮我看看这个哪里错了?

2024/12/25 13:39
加载中...