Programming contests

20 Programming Exercise for Beginners

January 1, 2019 12:00 AM – December 31, 2019 12:00 AM

Selecting Numbers based on their Octal Form

Create a program that enumerates all odd numbers between -100 and +100 that contain the digit 1 in their octal form in ascending order.

Hints and Guide

To convert a number to octal form, we recommend using the sprintf function.

One possible solution is available in: main.c.

Possible Improvements

In programming contests where the execution time is crucial, a widely used technique is to store the constant output of the application (for example in an array) to avoid the delay caused by the calculation. We can apply this trick in our scenario since we need to store at most 100 integer.

Acknowledgement This work was supported by the construction EFOP-3.4.3-16-2016-00021. The project was supported by the European Union, co-financed by the European Social Fund.
University of Debrecen; Faculty of Informatics; v. 03/01/2019