Skip to content

Commit

Permalink
Add tutorial for dimik-descending-number (#467)
Browse files Browse the repository at this point in the history
* Creating an editorial for dimik-descending-number

* Update en.md

* Update en.md

* Update en.md

* Update en.md
  • Loading branch information
nfpranta committed Dec 3, 2023
1 parent 02bcb01 commit 6fc38f5
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions dimik-descending-number/en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Dimik - Descending Number

In this problem,you will not be given any inputs. The only thing which you will have to do is to print all the numbers starting from 1 upto 1000 but in descending order.

### Solution
* Each number has to be seperated using the `space` character.
* Each line will consist of exactly 5 numbers not more nor less.

### C++
```cpp
#include <bits/stdc++.h>
using namespace std;
int main()
{
int cnt = 0;
for (int i = 1000; i >= 1; i--)
{
cout << i;
if(i%5!=1) cout<<" ";
cnt++;
if (cnt == 5)
{
cout << endl;
cnt = 0;
}
}
}
```

0 comments on commit 6fc38f5

Please sign in to comment.