Programming contests

50 Programming Exercise for Beginners

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

Airplanes

Write a program that reads a list of airplane types from the text file given as the first command line argument, one per line. Each line has the following structure:

manufacturer;type;length

manufacturer and type are strings of up to 50 characters without spaces and semicolons, and length is a real number of up to 8 characters. The program should write to the standard output those manufacturers and types, separated by a space, the length of which is at least the value specified in the second command line argument.

Hint: see atof() or sscanf() functions for converting a string to a real number.

Sample Input

  1. prog airplanes.txt 50
download as text file

Sample airplanes.txt

  1. Airbus;A320;37.57
  2. Airbus;A380;72.73
  3. Boeing;737-800;39.5
  4. Boeing;747-8;76.3
download as text file

Output for Sample Input

  1. Airbus A380
  2. Boeing 747-8
download as text file
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. 09/30/2024