[亲和数]-题解(C++代码) 摘要:解题思路:输入m确定循环次数,输入ab,判断a的因数和是否等于b并且b的因数和是否等于a,输出结果注意事项:参考代码:/* 1157 */ #include <cstdio> #include…… 题解列表 2020年08月26日 0 点赞 0 评论 565 浏览 评分:0.0
一目了然- 亲和数用while、for 摘要:解题思路:注意事项:参考代码:#include<iostream>usingnamespacestd;intmain(){ int&nb…… 题解列表 2025年03月12日 0 点赞 0 评论 161 浏览 评分:0.0
亲和数c++语言 摘要:#include<iostream> using namespace std; int Yue(int n) { int sum = 0; for (int i = 1; i < n;…… 题解列表 2024年10月19日 0 点赞 0 评论 156 浏览 评分:0.0
1157: 亲和数 摘要:```cpp #include using namespace std; int qhs(int x,int y){ int a=0,b=0; for(int i=1;i…… 题解列表 2024年07月25日 0 点赞 0 评论 119 浏览 评分:0.0
1157: 亲和数 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;typedef long long ll;ll qinhe(ll x){ l…… 题解列表 2024年07月10日 0 点赞 0 评论 167 浏览 评分:0.0
题解 1157: 亲和数 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;typedef long long ll;ll a[100000],b[10000…… 题解列表 2024年07月10日 0 点赞 0 评论 116 浏览 评分:0.0
1157亲和数(简单的统计约数求和) 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int N; cin >> N; while (N) { int a…… 题解列表 2024年07月09日 0 点赞 0 评论 171 浏览 评分:0.0
亲和数(判约数的基本功) 摘要:解题思路:因为要判断是否约数,所以要使用暴力搜索(其实就是for循环)来查找,找到了就累加,再判断是否与输入的两个数相等。注意事项:1.计数器要清零 2.题目说了“不包含本身”,所以不能执行到这个数,…… 题解列表 2022年05月09日 0 点赞 0 评论 309 浏览 评分:0.0
亲和数简单明了的题解 摘要:解题思路:编写一个函数便于解题注意事项:参考代码:#include<iostream>using namespace std;int Sum(int k){ int sum = 0; for (int…… 题解列表 2022年05月06日 0 点赞 0 评论 186 浏览 评分:0.0
[亲和数]-题解(C++代码) 摘要:解题思路:设aa数组和bb数组分别存A和B的真约数,设ans1和ans2分别累加A和B的真约数。最后判断ans1=B并且ans2=A即输出YES否则输出NO。注意事项:每次while循环更新q1,q2…… 题解列表 2021年01月22日 0 点赞 0 评论 442 浏览 评分:0.0