雾山五行


私信TA

用户名:uq_26515002996

访问量:742

签 名:

等  级
排  名 11001
经  验 1055
参赛次数 0
文章发表 14
年  龄 0
在职情况 在职
学  校
专  业

  自我简介:

解题思路:

注意事项:

参考代码:

                                    #include<stdio.h>

                                    int f(int a){

                                         int s=0;

                                         for(int i=1;i<=a/2;i++){

                                             if(a%i==0)

                                                 s+=i;

                                         }

                                         return s;

                                    }

                                    int main()

                                    {

                                         int b=0;

                                         for(int i=2;i<=3000;i++){

                                              b=f(i);

                                              if(i==f(f(i)) && i<b) 

                                                  printf("(%d,%d)",i,b);

                                         }

                                         return 0;

                                    }


 

0.0分

0 人评分

  评论区

  • «
  • »