Piramida

  • July 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Piramida as PDF for free.

More details

  • Words: 95
  • Pages: 1
#include #include using namespace std; void piramida (int); void main () { int n; cout << "Introduceti inaltimea: "; cin >> n; piramida (n); getchar (); getchar (); } void piramida (int n) { if (n %2 == 0) { for (int i=1; i<=n; i++) { cout << setw (n-i+2); for (int k=1; k<=i*2; k++) { cout << "x"; } cout << endl; } } else { for (int i=1; i<=n; i++) { cout << setw (n-i+2); for (int k=2; k<=i*2; k++) { cout << "x"; } cout << endl; } } }

Related Documents

Piramida
July 2020 9
Piramida Alimentara.docx
December 2019 23
Piramida Penduduk.docx
December 2019 24
Rahasia Piramida
November 2019 17
Piramida Penduduk Word
August 2019 18
Piramida Misteri Part 1
April 2020 13