Advertisement
idsystems

CPP_Practica59_Rombo

Mar 13th, 2013
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. // Program: rombo.cc
  2. // Author:  Yoan Pinzon
  3. // Date:    Agosto 30, 2006
  4.  
  5. #include <iostream>
  6. #include <string>
  7.  
  8. using namespace std;
  9.  
  10. int main(){
  11.    char c;
  12.    int n;
  13.    string x="* ";
  14.  
  15.    cout << "Entre un caracter: "; cin >> c;
  16.    cout << "Entre n: "; cin >> n;
  17.    x[0] = c;
  18.    for(int i=0; i<n; i++)
  19.       for(int j=0; j<n; j++) cout << (j<n-i?" ":x) << (j==n-1?"\n":"");
  20.    for(int i=n; i>0; i--)
  21.       for(int j=0; j<n; j++) cout << (j<n-i?" ":x) << (j==n-1?"\n":"");
  22.    
  23.    return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement