Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- /* MinGW build EXE
- G++ TamGiacSo.cpp -o TamGiacSo.exe && TamGiacSo.exe
- */
- using namespace std;
- int main(int, const char * [])
- {
- int N = 0;
- cout << "Enter a number (0-9): "; cin >> N;
- for(int i = 1; i <= N; i++) {
- cout << '\n';
- for(int j = 1; j <= N - i; j++) cout << '\x20';
- for(int k = 1; k <= i; k++) cout << k;
- for(int l = i - 1; l >= 1; l--) cout << l;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment