P5721 【深基4.例6】數字直角三角形 題解

我的代碼

#include <iostream>
using namespace std;
int i=1;
int main(int argc, char const *argv[])
{
	int n;cin >> n;
	while(n)
	{
		for(int j = 1;j <= n;j++)
		{
			if(i < 10)cout << '0';
			cout << i;
			i++;
		}
		cout << endl;
		n--;
	}
	return 0;
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章