#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