三九宝宝网宝宝百科宝宝知识

include stdio h define N 1000 main int i j t k 0 aN s fori 2 i

04月03日 编辑 39baobao.com

[物化视图日志加不加INCLUDING NEW VALUES有什么影响]NEW VALUES Clause The NEW VALUES clause lets you determine whether Oracle Database saves both old and new values for update DML operations in the materialized v...+阅读

我猜你这个是书上的作业吧!我的技术也不是很好,只能勉强看哈!

其实有个最重要的错误就是在最后输出那里.......我调试了哈~结果只有3个数,6,28,469;

#include "stdio.h"

#define N 1000

main() //这里貌似少了void

{int i,j,t,k=0,a[N],s;

for(i=2;i

{s=0;

for(j=1;j<=i;j++)//这里应该是<;而不是<;=吧

if(i%j==0)

{a[k++]=j;

s=s+j;

}

if(i==s)

{printf("%d is a wanshu,its factors are:\n",i);

for(t=0;t

printf("%d ",a[t]);

printf("\n");//这里不应该有这个,应该去掉,后面也不能有

}

}

}

下面是我自己的代码你看看吧...#include

void main()

{

int m,i,j,s;

for(m=6;m<1000;m++)

{

s=m-1;

for(i=2;i

if(m%i==0) s=s-i;

if(s==0)

{

printf("%d is a wanshu,its factors are:1\n",m);

for(j=2;j

if(m%j==0)

printf("%d\n",j);

printf("---------------------\n");

}

}

}

或者

#include

void main()

{

int m,i,j,s;

for(m=6;m<1000;m++)

{

s=1;

for(i=2;i

if(m%i==0) s=s+i;

if(m==s)

{

printf("%d is a wanshu,its factors are:1\n",m);

for(j=2;j

if(m%j==0)

printf("%d\n",j);

printf("---------------------\n");

}

}

}

以下为关联文档:

includer什么意思及同义词包括;包含: The farm includes 150 acres. 这个农场有150英亩。 There are 10 people including you. 包括你有10个人。 列入,计入: to include the freight in the account 将...

推荐阅读
图文推荐