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

全部评论

相关推荐

牛客83700679...:简历抄别人的,然后再投,有反馈就是简历不行,没反馈就是学历不行,多投多改只要技术不差机会总会有的
点赞 评论 收藏
分享
舂锋:不能投什么岗都用一份简历,一般都是要看企业的岗位需求来写职业技能或者是项目经历,跟岗位相关的就写多一点。
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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