你的旅行開始了
眾所周知,每顆慧星后面都有不明飛行物(UFO). 這些不明飛行物常常在這里尋找忠誠的支持者. 不幸的是,他們每次旅行只有空間帶走一群支持者. 不過,他們總是通過一個聰明的方案讓這群人提前知道誰會被帶到哪個慧星上去: 他們?yōu)槊款w慧星取個名字,也給每個小組取個名, 這樣就能夠決定是否輪到該小組(你覺得誰會命名慧星呢?). 搭配方案的細節(jié)如下; 你的任務(wù)是編寫一個帶有小組和慧星的名字的程序,然后決定這個小組是否應(yīng)和UFO一起追隨慧星.
小組和慧星的名字通過下面的辦法轉(zhuǎn)換成數(shù)字: 最終的數(shù)字是名字中字母所在字母表位置的乘積, 即A等于1,Z等于26. 例如,組"USACO" 應(yīng)該是21 * 19 * 1 * 3 * 15 = 17955. 如果組的余數(shù)47 與慧星的余數(shù)47相同, 你就可以告訴這個組準備出發(fā)了! (注意"a 除 b的余數(shù)" 是a 被b除后剩下的數(shù); 34 除以10 余 4.)
編程讀出慧星和小組的名字并指出以上兩者是否相配, 如果相配輸出"GO"否則輸出 "STAY" . 小組和慧星的名字是一串不含標點和空格的大寫字母, 不超過6個字母.
英語翻譯
英語翻譯
Your Ride Is Here
It is a well-known fact that behind every good comet is a UFO.These UFOs often come to collect loyal supporters from here on Earth.Unfortunately,they only have room to pick up one group of followers on each trip.They do,however,let the groups know ahead of time which will be picked up for each comet by a clever scheme:they pick a name for the comet which,along with the name of the group,can be used to determine if it is a particular group's turn to go (who do you think names the comets?).The details of the matching scheme are given below; your job is to write a program which takes the names of a group and a comet and then determines whether the group should go with the UFO behind that comet.
Both the name of the group and the name of the comet are converted into a number in the following manner:the final number is just the product of all the letters in the name,where "A" is 1 and "Z" is 26.For instance,the group "USACO" would be 21 * 19 * 1 * 3 * 15 = 17955.If the group's number mod 47 is the same as the comet's number mod 47,then you need to tell the group to get ready!(Remember that "a mod b" is the remainder left over after dividing a by b; 34 mod 10 is 4.)
Write a program which reads in the name of the comet and the name of the group and figures out whether according to the above scheme the names are a match,printing "GO" if they match and "STAY" if not.The names of the groups and the comets will be a string of capital letters with no spaces or punctuation,up to 6 characters long.
Your Ride Is Here
It is a well-known fact that behind every good comet is a UFO.These UFOs often come to collect loyal supporters from here on Earth.Unfortunately,they only have room to pick up one group of followers on each trip.They do,however,let the groups know ahead of time which will be picked up for each comet by a clever scheme:they pick a name for the comet which,along with the name of the group,can be used to determine if it is a particular group's turn to go (who do you think names the comets?).The details of the matching scheme are given below; your job is to write a program which takes the names of a group and a comet and then determines whether the group should go with the UFO behind that comet.
Both the name of the group and the name of the comet are converted into a number in the following manner:the final number is just the product of all the letters in the name,where "A" is 1 and "Z" is 26.For instance,the group "USACO" would be 21 * 19 * 1 * 3 * 15 = 17955.If the group's number mod 47 is the same as the comet's number mod 47,then you need to tell the group to get ready!(Remember that "a mod b" is the remainder left over after dividing a by b; 34 mod 10 is 4.)
Write a program which reads in the name of the comet and the name of the group and figures out whether according to the above scheme the names are a match,printing "GO" if they match and "STAY" if not.The names of the groups and the comets will be a string of capital letters with no spaces or punctuation,up to 6 characters long.
英語人氣:668 ℃時間:2019-12-25 22:23:25
優(yōu)質(zhì)解答
我來回答
類似推薦
- Your ride is here~暈死
- Is here your home?怎么回答?是Yes,here is?
- here is your carhere your car is
- is your office far from here.No,it's just ()ride
- () ride your bicycle here!
- 某公司有三支獲利是相互獨立的股票,且股票獲利的概率分別為0.8 0.6 0.5 1,求任兩支股票至少有一支獲利的概率,2,三支股票至少有一支股票獲利的概率
- 七分之五減去一個數(shù),21分之一加上同一個數(shù),兩次計算結(jié)果相同,求這個同一個分數(shù)是多少
- Welcome to Beijing Seven-day Vacation The round trip will cost $3,800 in all.Some additional fees
- 誰可以幫的把下面的話給翻譯成英文 對不起我不得不離開,因為我不是你夢里的那個男孩
- 對a,b∈R,記max{a,b}=a,a≥bb,a<b,函數(shù)f(x)=max{|x+1|,|x-2|}(x∈R)的最小值是( ?。?A.0 B.12 C.32 D.3
- 甘蔗的出場率是百分之四十,一個糖廠要在榨糖1200千克,需要甘蔗多少千克?
- 半桶水加半桶水等于多少?
猜你喜歡
- 1I leart French---myself a.by all of b.all of by
- 2同分子異分母分式方程怎么解
- 3孫泰軼事文中的兩件事體現(xiàn)了孫泰怎樣的思想品德 快~~~~
- 4想問表示烹調(diào)的英語詞匯
- 5用所給動詞的適當(dāng)形式填空When——your school day usually ——(start)?
- 6為什么 向量A·B是數(shù)值而向量AxB是向量
- 7用數(shù)學(xué)歸納法證明“(n+1)(n+2).(n+n)=1*3*...*(2n-1)*2^n”時“從k到k+1”左邊需要增乘的代數(shù)式是
- 81、一個圓柱體,它的側(cè)面展開后正好是一個長方形,這個長方形的長與寬的比是 2:1,它的底面周長與高的比是多少?
- 9求數(shù)列2,22,222.的前n項的和
- 10少年閏土這篇課文的大意是什么
- 11莫登山隊登珠穆朗瑪峰成功后返回一號營地,在海拔8000m時測得溫度是-47度,在到達一號營地后測得溫度是-20攝氏度.已知該地區(qū)海拔高度每增加100m氣溫均下降0.6攝氏度問:一號營地的海拔高度是多少米?若登山隊的大本營建在海拔500米處,
- 12We have a school day on september 12th改為一般疑問句