a228: pJ Count! Count! Count!
標籤 : string
通過比率 : 48人/50人 ( 96% ) [非即時]
評分方式:
Tolerant

最近更新 : 2019-12-13 17:05

內容

This is a problem written in English.

Rex's English teacher asked him to submit a paragraph written in English. However, unfortunately, there is a word limit. 

Given $l$ represents the word limit, and $count$ represents the number of the words in his paragraph

If $ \mid  l - count \mid \leq 10 $ , He will be safe.

Otherwise, he will be punished.

For example

The limit is 50 words

Given a paragraph as follows

And after all these things are his, add, I pray, enough of a sense of humor, so that he may always be serious, yet never take himself too seriously. Give him humility, so that he may always remember the simplicity of greatness, the open mind of true wisdom, the meekness of true strength.

extract from A Father's Prayer by General Douglas MacArthur

$l=50, count=53, \mid l-count \mid \leq 10$ 

Rex will be safe!

 

輸入說明

Multiple Test Data

Input $l$ in the first line.

Then, input a paragraph.

 

輸出說明

If $ \mid  l - count \mid \leq 10 $ , output "\ Rex is SAFE /"

Otherwise, output "POOR REX!"

範例輸入
20
Now at a time when carbon emissions and our planet's well-being are in the spotlight, can a return to commercial supersonic flight really be sustainable, profitable for airlines and manufacturers, and affordable for passengers?

50
And after all these things are his, add, I pray, enough of a sense of humor, so that he may always be serious, yet never take himself too seriously. Give him humility, so that he may always remember the simplicity of greatness, the open mind of true wisdom, the meekness of true strength.
範例輸出
POOR REX!
\ Rex is SAFE /
測資資訊:
記憶體限制: 64 MB
公開 測資點#0 (20%): 1.0s , <1K
公開 測資點#1 (20%): 1.0s , <1M
公開 測資點#2 (20%): 1.0s , <1K
公開 測資點#3 (20%): 1.0s , <1M
公開 測資點#4 (20%): 1.0s , <1K
提示 :

To avoid disputes, $ count= (number\  of\  spaces)+1 $

標籤:
string
出處:
108年學年度復旦程式設計班初階班期中考 [管理者:
fdhs107BensonQB (邱秉辰)
]


編號 身分 題目 主題 人氣 發表日期
沒有發現任何「解題報告」