题解 1157: 亲和数

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

亲和的解法

摘要:解题思路:注意事项:刚开始我做的代码是一组一组的吸收数据并得出结果,然后想到了利用数组的办法来收集结果并统一输出参考代码:#include <stdio.h>#include <stdlib.h>in……

【亲和数】 (C语言代码)

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int f(int a,int b);int main(){    int M,A,B;    scanf("%d",&M);    w……

【亲和数】 (C语言代码)

摘要:解题思路:注意事项:参考代码:#include<stdio.h>main(){int m,a,b;   scanf("%d",&m);        for(int i=0;i<m;i++)     ……

【亲和数】 (C语言代码)

摘要:解题思路:就是循环嵌套注意事项:参考代码:#include<stdio.h>#include<stdlib.h>int main(){ int a; int shu1,shu2; int i,j; ……

【亲和数】 (C语言代码)

摘要:注意事项:各位智商都比我高,我就不BB了参考代码:代码1: (我已经很努力了,但还是很长O.O)#include<stdio.h>int main(){    int M,a,b,sum_a,sum_……

【亲和数】 (C语言代码)

摘要:解题思路:思路在题目中已经给的很清楚了,如果两个数中任何一个数都是另一个数的真约数之和,则这两个数就是亲和数。那就先编写一个子函数来求真约数之和,如我代码中的int divisorsum(int a)……

【亲和数】 (C语言代码)

摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main(void){ int i, j, l, m, n, sum, sum1, hang; scanf("%d", &ha……

【亲和数】 (C语言代码)

摘要:解题思路:注意事项:参考代码:#include<stdio.h>#define uint unsigned intuint add(uint x);int main(){  uint a,i,j;  ……

【亲和数】 (C语言代码)

摘要:解题思路:注意事项:参考别人写的代码做了些修改感觉比上一个更简约。参考代码:#include<stdio.h>#define uint unsigned intuint add(uint x);int……

【亲和数】 (C语言代码)

摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main(){int n,a,b,flag,sum,c;scanf("%d",&n);while(n--){flag=0;su……