这是我的代码
#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 “
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.