Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- using namespace std;
- void lineas(int N,int i){
- int k;
- for(k=1;k<=N-i;k++){cout<<" ";}
- for(k=1;k<=2*i-1;k++){
- cout<<k;
- if(k<2*i-1){cout<<" ";}}
- }
- int main(){
- int i,N;
- cin>>N;
- cout<<endl;
- for(i=1;i<=N;i++){
- cout<<endl;
- lineas(N,i);
- cout<<endl;}
- for(i=N-1;i>=1;i--){
- cout<<endl;
- lineas(N,i);
- cout<<endl;}
- _getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement