当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

1320:Street Numbers

题目描述
A computer programmer lives in a street with houses numbered consecutively (from 1) down one side of the street. Every evening she walks her dog by leaving her house and randomly turning left or right and walking to the end of the street and back. One night she adds up the street numbers of the houses she passes (excluding her own). The next time she walks the other way she repeats this and finds, to her astonishment, that the two sums are the same. Although this is determined in part by her house number and in part by the number of houses in the street, she nevertheless feels that this is a desirable property for her house to have and decides that all her subsequent houses should exhibit it.
Write a program to find pairs of numbers that satisfy this condition. To start your list the first two pairs are: (house number, last number):
         6         8

35 49
输入解释
There is no input for this program.
输出解释
Output will consist of 10 lines each containing a pair of numbers, in increasing order with the last number, each printed right justified in a field of width 10 (as shown above).
输出样例
         6         8
        35        49

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-1320

最后修改于 2020-10-29T06:00:51+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 10000