| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 909 人关注过本帖
标题:[求助]一道ACM竞赛题
取消只看楼主 加入收藏
孟庆磊
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2007-3-12
收藏
 问题点数:0 回复次数:1 
[求助]一道ACM竞赛题
1.Four in row
Given a positive integer,tell wherther it is equal to the sum of four consecutive integers.
Input
A positive integer(<2的31次幂),each case will be on separate line .A zero(0)denotes the end of input.
Output
The phrase"is not the sum of four consecutive integers"or the phrase"is the sum of four consecutive integer "where is the number in qusetion.
Example
in this example,2=-1+0+1+2,and82=19+20+21+22,5 and 41are not of the correct form.
Input
2
5
41
82
0
Output
2 is the sum of four consecutive integers.
5 is not the sum of four consecutive integers.
41 is not the sum of four consecutive integers.
82 is the sum of four consecutive integers
搜索更多相关主题的帖子: 竞赛题 ACM sum integer four 
2007-06-28 19:18
孟庆磊
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2007-3-12
收藏
得分:0 
这是一本书上的,我当时也是这么想的,但是老师说太简单了要我完善下。汗!!我都不知道具体怎么完善!!

2007-06-29 20:27
快速回复:[求助]一道ACM竞赛题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.026848 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved