Programozó versenyek

Programozás labor, gyakorló feladatok

2017. május 17. 8:15 – 2017. május 17. 13:35

Mondatzáró írásjelek

Írjon programot, amely a standard bemenetről soronként egy legfeljebb 100 karakter hosszúságú sztringet olvas be mindaddig, amíg egy olyan sztringet nem olvas, amelynek az utolsó három karaktere három felkiáltójel (!!!)! A program írja a standard kimenetre azokat a sorokat, amelyek pontra, kérdőjelre vagy felkiáltójelre végződnek, beleértve a bemenet végét jelző sort is!

Példa bemenet

  1. Addressed To Haydon
  2. High-mindedness, a jealousy for good,
  3. A loving-kindness for the great man's fame,
  4. Dwells here and there with people of no name,
  5. In noisome alley, and in pathless wood:
  6. And where we think the truth least understood,
  7. Oft may be found a "singleness of aim,"
  8. That ought to frighten into hooded shame
  9. A money-mongering, pitiable brood.
  10. How glorious this affection for the cause
  11. Of steadfast genius, toiling gallantly!
  12. What when a stout unbending champion awes
  13. Envy and malice to their native sty?
  14. Unnumbered souls breathe out a still applause,
  15. Proud to behold him in his country's eye.
  16. John Keats
  17. !!!...!!!
letöltés szöveges állományként

A példa bemenethez tartozó kimenet

  1. A money-mongering, pitiable brood.
  2. Of steadfast genius, toiling gallantly!
  3. Envy and malice to their native sty?
  4. Proud to behold him in his country's eye.
  5. !!!...!!!
letöltés szöveges állományként
Debreceni Egyetem, Informatikai Kar, v. 2019.03.01.