Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main()
- {
- int N;
- cin>>N;
- int temp=N+2;
- for (int i = 1; i <= N; i++) //Run line
- {
- for(int k=1;k<i;k++ )
- cout<<" ";
- for (int j = 1; j<= temp; j++)// Run number
- {
- cout<<i<<" ";
- }
- cout<<"\n";
- temp=temp-2;
- if(temp==0)
- temp=1;
- else if(temp==-1)
- temp=1;
- }
- }
Add Comment
Please, Sign In to add comment