Programozó versenyek

Magas szintű programozási nyelvek 1, 2018. május 14., H16 ZH

2018. május 14. 16:35 – 2018. május 14. 18:20

Igazgató

Írjon programot, amely parancssori argumentumként megkap egy nemnegatív egész számot (n-et) és egy szöveges állomány nevét! A programja n mező szélességben igazítsa jobbra a szöveges állomány sorait, ha azok egyikének a hossza sem haladja meg n értékét! Ha az állomány bármelyik sorának hossza nagyobb lenne n-nél, akkor az eredeti sorokat csonkolja n hosszúságúra, és az így kapott sorokat jelenítse meg a standard kimeneten!

A shakespeare.txt állomány tartalma

  1. Two households, both alike in dignity,
  2. In fair Verona, where we lay our scene,
  3. From ancient grudge break to new mutiny,
  4. Where civil blood makes civil hands unclean.
  5. From forth the fatal loins of these two foes
  6. A pair of star-cross'd lovers take their life;
  7. Whose misadventured piteous overthrows
  8. Do with their death bury their parents' strife.
letöltés szöveges állományként

Parancssori argumentumok

  1. 10 shakespeare.txt
letöltés szöveges állományként

A futtatás eredménye a standard kimeneten

  1. Two househ
  2. In fair Ve
  3. From ancie
  4. Where civi
  5. From forth
  6. A pair of 
  7. Whose misa
  8. Do with th
letöltés szöveges állományként

Parancssori argumentumok

  1. 55 shakespeare.txt
letöltés szöveges állományként

A futtatás eredménye a standard kimeneten

  1.                  Two households, both alike in dignity,
  2.                 In fair Verona, where we lay our scene,
  3.                From ancient grudge break to new mutiny,
  4.            Where civil blood makes civil hands unclean.
  5.            From forth the fatal loins of these two foes
  6.          A pair of star-cross'd lovers take their life;
  7.                  Whose misadventured piteous overthrows
  8.         Do with their death bury their parents' strife.
letöltés szöveges állományként
Debreceni Egyetem, Informatikai Kar, v. 2019.03.01.