| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 509 人关注过本帖
标题:[求助]这个题结果对,但是提交错误,怎么回事啊
取消只看楼主 加入收藏
liewmn
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2007-9-19
收藏
 问题点数:0 回复次数:0 
[求助]这个题结果对,但是提交错误,怎么回事啊

这是我的代码
#include<stdio.h>
int main()
{
int i,a[10000],b[10000];
for(i=1;i<=10;i++)
{
scanf("%d",&a[i]);
if(a[i]==0)
break;
}
for(int k=1;k<i;k++)
b[k]=a[k];
for(int j=1;j<=i-1;j++)
{
if((b[j]-6)%4==0)
{
printf("%d is the sum of four consecutive integers.\n",b[j]); }
else
{
printf("%d]is not the sum of four consecutive integers.\n",b[j]); }

}
return 1;
}
这是题目
Input
A positive integer(<231), each case will be on a 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 integers.”, where is the number in question.
Example
In this example, 2 = -1 + 0 + 1 + 2, and 82 = 19 + 20 + 21 + 22. 5 and 41 are not of the correct form.
Input
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.

搜索更多相关主题的帖子: 结果 int main include 
2007-10-11 23:28
快速回复:[求助]这个题结果对,但是提交错误,怎么回事啊
数据加载中...
 
   



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

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