编程介的小学生 2019-05-13 14:17 采纳率: 20.5%
浏览 126

出名的程度的判断分析的算法,利用C语言的代码程序编写的方式如何才能实现的?

Problem Description
Every one own herself hero. The different hero must be famous in different field. So to compare them is a difficult things. Now given every hero a integer value to express the degree of famous. We call it Fv.
yifenfei want to know who is the most famous hero, so he ask many people to get the answer. Lots of people tell him as that: the Fv of hero A / the Fv of hero B equal to p / q.

Input
There are multiple cases in the input file.
Each case contains n (0< n <=27)
Next follow n line, each line as (hero A name # hero B name, p , q ).Length of name less 100 (the name will no ”#”). p, q is A positive integer less 10.

Output
Out put every hero relative value, the answer should be smallest(order by the lexicographically of hero name). Out put a line after every case. You may sure every case has answer.

Sample Input
1
Zhao yun # ji yuan 4 6

2
Ji yuan # Lemon 3 5
Lemon # Qi shi wang 2 9

Sample Output
Zhao yun 2
ji yuan 3

Ji yuan 6
Lemon 10
Qi shi wang 45

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 ubuntu子系统密码忘记
    • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作
    • ¥15 求NPF226060磁芯的详细资料
    • ¥15 使用R语言marginaleffects包进行边际效应图绘制
    • ¥20 usb设备兼容性问题
    • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊
    • ¥15 安装svn网络有问题怎么办
    • ¥15 vue2登录调用后端接口如何实现