Skip to content

Commit 6fc38f5

Browse files
authored
Add tutorial for dimik-descending-number (lightoj-dev#467)
* Creating an editorial for dimik-descending-number * Update en.md * Update en.md * Update en.md * Update en.md
1 parent 02bcb01 commit 6fc38f5

File tree

1 file changed

+28
-0
lines changed
  • dimik-descending-number

1 file changed

+28
-0
lines changed

dimik-descending-number/en.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Dimik - Descending Number
2+
3+
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.
4+
5+
### Solution
6+
* Each number has to be seperated using the `space` character.
7+
* Each line will consist of exactly 5 numbers not more nor less.
8+
9+
### C++
10+
```cpp
11+
#include <bits/stdc++.h>
12+
using namespace std;
13+
int main()
14+
{
15+
int cnt = 0;
16+
for (int i = 1000; i >= 1; i--)
17+
{
18+
cout << i;
19+
if(i%5!=1) cout<<" ";
20+
cnt++;
21+
if (cnt == 5)
22+
{
23+
cout << endl;
24+
cnt = 0;
25+
}
26+
}
27+
}
28+
```

0 commit comments

Comments
 (0)