12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
#include <iostream> using namespace std; void input(int &height, int &seed1){ cout<<"Your first num:"; cin>>seed1; cout<<"Your height: "; cin>>height; } void output (int height, int seed1){ int n; int n1; int n2; for(n=0; n<height; n++){ for (n1=0; n1<=n; n1++){ if (seed1>=10){ seed1=seed1-10; } cout<<seed1; seed1++; } cout<<endl; } } int main(){ int height; int seed1; input(height,seed1); output(height,seed1); return 0; }
1234567891011121314151617181920212223242526
void output (int height, int seed1) { int n; int n1; int n2; for(n=0; n<height; n++) { for (int k=0; k<(height-n)/2; ++k) { cout << ' '; } for (n1=0; n1<=n; n1++) { if (seed1 >= 10){ seed1 = seed1-10; } cout<<seed1; seed1++; } cout<<endl; } }