求大家给点帮助,计算机专业新手学C语言写程序遇到问题,请大家看看
首先输入一个n,代表有n个网页的源代码。然后依次输入n个网页的HTML源代码,格式按上述给出。
本题为单组测试用例。
4
<html>
<!--http://a.com-->
<head>
<title>study</title>
</head>
<body>
<text>
nothing is impossible.<a href="http://b.com">me</a>
<a href="http://c.com">you</a>
<a href="http://d.com">him</a>
</text>
</body>
</html>
<html>
<!--http://b.com-->
<head>
<title>Give me More</title>
</head>
<body>
<text>
I love choices.
<a href="http://a.com">see also</a>
<a href="http://c.com">click me</a>
</text>
</body>
</html>
<html>
<!--http://c.com-->
<head>
<title>New Year</title>
</head>
<body>
<text>
Happy new year!
<a href="http://d.com">buy a gift</a>
</text>
</body>
</html>
<html>
<!--http://d.com-->
<head>
<title>gift</title>
</head>
<body>
<text>
purchase<a href="http://a.com">do you like this?</a>
<a href="http://b.com">click me</a>
</text>
</body>
</html>
输出
--------------------------------------------------------------------------------
输出按PageRank值从高到低排列,如果PageRank值相同,则按网址的字典顺序从小到大排列。输出内容为文章标题(title标签中)、网址、PageRank值(保留4位小数)。
gift http://d.com 0.2904
study http://a.com 0.2604
Give me More http://b.com 0.2356
New Year http://c.com 0.2137
这个是题目 我自己的思想是如果i可以链接到j就把矩阵的Pij变为1,否则为0,计算pagerank的那个部分我已经可以完成,就是不知道怎么完成输入和输出(题目输入这么多怎么可以得到自己想要的一部分)
弄了好多天,还是没有明白,求大家指导,帮忙写出代码,(如果可以留下QQ交流一下)真心求教了