Created
October 15, 2024 12:30
-
-
Save juanfal/3cbe9584f98d2f2dc17eacb33a11f5b6 to your computer and use it in GitHub Desktop.
print continous counter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 08.triangleContDigits.cpp | |
// juanfc 2024-10-07 | |
// | |
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
int gCounter = 1; | |
int n = 12; // or cin >> n; | |
for (int line = 1; line <= n; ++line) { | |
for (int i = 0; i < line; ++i) | |
cout << gCounter++ % 10; | |
cout << endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment