i与j

数字三角形

https://ac.nowcoder.com/acm/contest/67628/1015

#include #include #include #define endl '\n' #define buff ios::sync_with_stdio(false),cin.tie(nullptr),cout.tie(nullptr); using namespace std; int main() {

ios::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);

int n;
cin>>n;
for(int i=1;i<=n;i++)
{
	for(int j=1;j<=i;j++)
	{
		cout<<i;
	}
	cout<<'\n';
}

return 0;

}

#include<iostream>

#include #include #define endl '\n' #define buff ios::sync_with_stdio(false),cin.tie(nullptr),cout.tie(nullptr); using namespace std; int main() { ios::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);

int n;
cin>>n;
for(int i=1;i<=n;i++)
{
	for(int j=1;j<=i;j++)
	{
		cout<<j<<" ";
	}
	cout<<'\n';
}

return 0;

}

输入

4 输出 1 1 2 1 2 3 输入 3 输出 1 22 333

全部评论

相关推荐

06-02 15:53
阳光学院 Java
点赞 评论 收藏
分享
06-20 17:42
东华大学 Java
凉风落木楚山秋:要是在2015,你这简历还可以月入十万,可惜现在是2025,已经跟不上版本了
我的简历长这样
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务