跟答案一模一样 1-9都试了怎么是零分
查看原帖
跟答案一模一样 1-9都试了怎么是零分
577426
are_trying_coding楼主2021/11/23 14:03
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,i,j,cnt;
	cin>>n;
		for(j=1;j<=n*n;j++)
		{
			if(j<10) cout<<0<<j;
			else cout<<j;
			if(!(j%n)) cout<<endl;
		}
		cout<<endl;
		i=2*n;
		while(i>0)
		{
			if(i>0)
			i-=2;
			for(j=0;j<i;j++) cout<<" ";
			for(j=0;j<(2*n-i)/2;j++)
			{
				cnt++;
				if(cnt<10)cout<<0<<cnt;
				else cout<<cnt;
			}
			cout<<endl;
		}	
		
		return 0;
}
		
	
 
2021/11/23 14:03
加载中...