题解 1157: 亲和数

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

筛选

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

摘要:参考代码:#include<stdio.h> int main() {  int a, b, i, n,e, sum1=0,sum2=0;  //sum1是保存数b的因数和,sum2是保存数a的……

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

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

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

摘要:解题思路:注意事项:参考代码:#include <stdio.h>#include <stdlib.h>int main() {     int M;     int *a, *b;        i……

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

摘要:解题思路:注意事项:注意sum1和sum2每次循环归零 参考代码:#include<stdio.h>int main(){ int n=0,a=0,b=0,sum1=0,sum2=0,i=0,k=0;……

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

摘要:解题思路:1判断a, b的输入条件2分别判断a,b互相的真约数是否与对方相等3如果有一个相等即可输出YES,a,b不符合条件或者不存在相等则输出NO注意事项:参考代码:#include<stdio.h……

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

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

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

摘要:解题思路:        m控制行数,循环里面输入两个数,通过求出一个数的真约数来与另一个数进行比较注意事项:        1.真约数不可能大于原数的一般,故只需i>=a/2;        2.可……

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

摘要:解题思路:筛选出范围内的因子求和比较就可以了注意事项:别把把数本身加上去,即循环条件控制好参考代码:#include<bits/stdc++.h>int main(){    int M;    in……