From 248cb544da3f4871e2d69f88a9804090b105b9a3 Mon Sep 17 00:00:00 2001 From: Nafis Fuad Pranta Date: Sat, 8 Jul 2023 20:32:19 +0600 Subject: [PATCH 1/3] Adding a tutorial for dimik-box-1 --- dimik-box-1/en.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 dimik-box-1/en.md diff --git a/dimik-box-1/en.md b/dimik-box-1/en.md new file mode 100644 index 00000000..ae2f9887 --- /dev/null +++ b/dimik-box-1/en.md @@ -0,0 +1,29 @@ +# Dimik - Box 1 + +In this problem, you will be given `T` testcases.Each line of the testcase consist of an integer `n`.We just have to print `*` in `n` rows and `n` columns. + +### Solution +We can find the solution by running two nested loops.We run the outermost loop for each row and for each row we run the innermost loop for each column.The thing to observe here is we print an empty line between consecutive test cases.So there will be no empty lines after last test case. + +### C++ +```cpp +#include +using namespace std; +int main() +{ + int t; + cin >> t; + for (int k = 1; k <= t; k++) + { + int n; + cin >> n; + for (int i = 1; i <= n; i++) + { + for (int j = 1; j <= n; j++) + cout << "*"; + cout << endl; + } + if(k!=t) cout << endl; + } +} +``` From 3daa0fc9cc94542de1ae745f7db7a1062b48ed02 Mon Sep 17 00:00:00 2001 From: Nafis Fuad Pranta Date: Sat, 8 Jul 2023 20:35:35 +0600 Subject: [PATCH 2/3] Update en.md --- dimik-box-1/en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dimik-box-1/en.md b/dimik-box-1/en.md index ae2f9887..17a3a618 100644 --- a/dimik-box-1/en.md +++ b/dimik-box-1/en.md @@ -1,6 +1,6 @@ # Dimik - Box 1 -In this problem, you will be given `T` testcases.Each line of the testcase consist of an integer `n`.We just have to print `*` in `n` rows and `n` columns. +In this problem, you will be given `T` testcases.Each line of the testcase consists of an integer `n`.We just have to print `*` in `n` rows and `n` columns. ### Solution We can find the solution by running two nested loops.We run the outermost loop for each row and for each row we run the innermost loop for each column.The thing to observe here is we print an empty line between consecutive test cases.So there will be no empty lines after last test case. From b5559168575841906f39813184b0f4b1b8fcc5d1 Mon Sep 17 00:00:00 2001 From: Nafis Fuad Pranta Date: Sat, 8 Jul 2023 23:32:17 +0600 Subject: [PATCH 3/3] Update en.md --- dimik-box-1/en.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dimik-box-1/en.md b/dimik-box-1/en.md index 17a3a618..e2b15b8c 100644 --- a/dimik-box-1/en.md +++ b/dimik-box-1/en.md @@ -1,9 +1,9 @@ # Dimik - Box 1 -In this problem, you will be given `T` testcases.Each line of the testcase consists of an integer `n`.We just have to print `*` in `n` rows and `n` columns. +In this problem, you will be given `T` testcases. Each line of the testcase consists of an integer `n`. We just have to print `*` in `n` rows and `n` columns. ### Solution -We can find the solution by running two nested loops.We run the outermost loop for each row and for each row we run the innermost loop for each column.The thing to observe here is we print an empty line between consecutive test cases.So there will be no empty lines after last test case. +We can find the solution by running two nested loops. We run the outermost loop for each row and for each row we run the innermost loop for each column. The thing to observe here is we print an empty line between consecutive test cases. So there will be no empty lines after last test case. ### C++ ```cpp