英语翻译
题目
英语翻译
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.
答案
你的旅行开始了
众所周知,每颗慧星后面都有不明飞行物(UFO). 这些不明飞行物常常在这里寻找忠诚的支持者. 不幸的是,他们每次旅行只有空间带走一群支持者. 不过,他们总是通过一个聪明的方案让这群人提前知道谁会被带到哪个慧星上去: 他们为每颗慧星取个名字,也给每个小组取个名, 这样就能够决定是否轮到该小组(你觉得谁会命名慧星呢?). 搭配方案的细节如下; 你的任务是编写一个带有小组和慧星的名字的程序,然后决定这个小组是否应和UFO一起追随慧星.
小组和慧星的名字通过下面的办法转换成数字: 最终的数字是名字中字母所在字母表位置的乘积, 即A等于1,Z等于26. 例如,组"USACO" 应该是21 * 19 * 1 * 3 * 15 = 17955. 如果组的余数47 与慧星的余数47相同, 你就可以告诉这个组准备出发了! (注意 "a 除 b的余数" 是a 被b除后剩下的数; 34 除以10 余 4.)
编程读出慧星和小组的名字并指出以上两者是否相配, 如果相配输出"GO"否则输出 "STAY" . 小组和慧星的名字是一串不含标点和空格的大写字母, 不超过6个字母.
举一反三
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
最新试题
- the are____ movie A Wold Without Thieves tonight.
- 已知二次函数y=ax平方+bx-1的图像经过A(1,2) B(-1,0)
- 运用完全平方公式计算﹙3/4x-2/3y﹚²
- 这句话译成英文
- cosθ^2+cos(θ+π/3)^2-cosθcos(θ+π/3)化简
- 买一辆汽车,分期付款购买要加价7%,如果用现金购买就可以打九五折.刘老师算了算,发现分期付款购买要比现金购买多付2.4万元.这辆车的原价是多少万元?
- 学校把种植一批树苗的任务按人数分给六年级的三个班,一班正好分得全部树苗的百分之40,二班 有32人,三班有40人,二班应分得全部树苗的几分之几?三班呢?你知道一班有多少人?
- 求下面圆柱的表面积:1.高8分米 2.半径4厘米 3.周长=37.68厘米
- 已知cosθ=—3/5 ,且θ∈(π,3π/2),试计算:tan(θ-π/4 )的值为多少.
- “他有一个30岁人的头脑”的英语翻译
热门考点
- 某厂有甲、乙两条生产线先后投产,在乙生产线投产以前,甲生产线已生产了200吨成品,从乙生产线投产开始
- 英语作文:My birthday party
- 口里面一个女字是什么字,拼音怎么写得
- A1.B1.A2.B2为椭圆X^2/a+Y^2/b=1的四个顶点,F为右焦点,直线A1B2与直线B1F相交于T,线段OT与椭圆交M,M恰为OT中点,则该椭圆的离心率?
- “春风又绿江南岸,明月何时照我还”,王安石反复推敲“”字的故事
- 猫和狗在一个直径是100米的圆周上的同一点向反方向的方向运动,毛每分走12.56米,狗每分走18.84米
- 帮忙看下出口单价写法是否正确,
- 新制氯水中含有哪些离子?
- 等底等高的一个圆柱和一个圆锥的体积相差6.28立方厘米,圆柱和圆锥体积的和是()立方厘米.a.9.24
- 把一个高是10CM的圆柱,截成两个圆柱后表面积比原来增加了2.4平方厘米,那么原来圆柱的体积是什么?