Advertisement
JosepRivaille

P32533: Control C202E

Feb 26th, 2015
1,030
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. //Pre: introduïm un natural
  6. //Post: retorna una figura de n*n
  7. int main() {
  8.   int n;
  9.   cin >> n;
  10.   for (int i=n; i != 0; --i) {
  11.     for (int j=i-1; j != 0; --j) cout << '+';
  12.     cout << '/';
  13.     for (int k=i; k != n; ++k) cout << '*';
  14.     cout << endl;
  15.   }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement