diff options
Added my solutions to Sem. 03 exercises
1 files changed, 17 insertions, 0 deletions
| -rw-r--r-- | Year 1/Programming introduction/Solutions Sem. 03/08. Triangle.cpp | 17 |
diff --git a/Year 1/Programming introduction/Solutions Sem. 03/08. Triangle.cpp b/Year 1/Programming introduction/Solutions Sem. 03/08. Triangle.cpp new file mode 100644 index 0000000..fa2b501 --- /dev/null +++ b/Year 1/Programming introduction/Solutions Sem. 03/08. Triangle.cpp @@ -0,0 +1,17 @@ +#include <iostream> + +using namespace std; + +int main() +{ + int n; + cin >> n; + + for (int row = 1; row <= n; row++) + { + for (int col = 0; col < row; col++) + cout << "$ "; + + cout << endl; + } +} |
