有没有大佬教我一下三角形的代码,萌新刚学不会
查看原帖
有没有大佬教我一下三角形的代码,萌新刚学不会
735959
paulyang120楼主2022/10/17 17:22
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a;
	cin>>a;
	for(int i=1;i<=a;i++)
	{
		for(int j=a*i-a+1;j<a*i+1;j++)
		{
			if(j<10)
				cout<<'0'<<j;
			else
				cout<<j;
		}
		cout<<endl;
	}
	for(int i=1;i<=a;i++)
	{
	}
				
	
}
2022/10/17 17:22
加载中...