作者: Mash (賤胖) 看板: CK4-21
標題: 幫幫忙~
時間: Sun Mar 28 03:48:11 1999
拜託各位高手....我們的機車程式老師出了一題作業...時間三個星期....已經過去了..
我們班還沒有人寫出來....快幫幫我....
我們上學期的程設被當了一半..這學期只剩一半的人留下來了...我看..再下學期..
就沒人了啦...!!!!!!
我們老師說,這一題他大一的時候寫的作業....他們系上100多人只有2,3個寫出來.
幹....我們班只有25個吧....豈不是沒人寫的出來了...還出這種鳥題...唉....
題目如下:
------------------------------------------------------------------------------
You are to write a simplr text formatter which arranges input text according
to embedded commands in the input text. Every command begins with a period
and is positioned at the beginning of an input line all by itself. The
commands are explained as follows:
.p Output the current output line if there is one and then start a
new indented paragraph, with five spaces in the indentation.
Except for the first paragraph, there is a blank line before each
new paragraph unless a blanj line or lines are already present.
.ln Output the current output line without justification if there is
one.
.juston Turn on right justification, beginning with the current output
line. The last line of a paragraph is not justified.
.justoff Turn off justification, beginning with the current output line.
.ce n Output the current output line without justification if there is
one and then center the text n input lines on n output lines.
.sp n Output the current output line without justification if there is
one and then insert n blank output lines.
.cpon Start capitalization with the next word until capitalization
is turned off.
.cpoff Turn off capitalization.
.quoteon Output the current output line without justification if there
is one and then begin a quotation after a blank line. The left
margin of a quotation is moved 10 spaces to the right and the
line length become 60.
.quoteoff Output the current line of a quotation and terminate the
quotation. Resume normal text after a blank line.
For this program, the line length is set at 80 characters long. Each input
word is terminated by a space or spaces, a comma, a period, the newline
character, a colon, a semicolon, a question mark, or an exclamation mark.
Sentences are terminated similary, excluding the comma, the semicolon, the
newline character, and spaces. You should take care to capitalize the file
letter of a sentence if it is not already capitalized for you in the input.
You may assume there are no nested quotes and hyphenated words in the input.
------------------------------------------------------------------------------
靠....打的我超累的.....希忘各位高手能幫我想一點...一點點就行了....
不一定要全部寫出來....因為沒人寫出來....唉.......拜託了!!
P.S.我學的是ANSI C....拜託不要用一些C++的東西.....謝謝....如果實在逼不得以..
還是可以用了....少用就行了....
苦命的賤胖.....
--
※ Origin: 羅德島 ◆ From: 163.30.126.39