Programming contests

50 Programming Exercise for Beginners

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

Three is the Hungarian Justice

Write a program that reads an English word of up to 24 characters per line from the standard input until you the word „justice” is read for the third time. For each scanned word, including the third „justice”, determine whether it is shorter than 10 characters, longer than 10 characters, or exactly 10 characters long, and write to the standard output in a separate line a < (less than), > (greater than) or = (equal) character, respectively.

Input Specification

  1. program
  2. justice
  3. programming
  4. justice
  5. programmer
  6. justice
  7. programmability
  8. programmable
download as text file

Output Specification

  1. <
  2. <
  3. >
  4. <
  5. =
  6. <
download as text file

One possible solution is available in: main.c.

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