无限套娃,嵌套嵌套再嵌套 摘要:解题思路:无限套娃注意事项:参考代码:#include <stdio.h>#include <stdlib.h>int main() { int n,i,j,s,sum,p; scanf("%d",&…… 题解列表 2024年11月26日 1 点赞 0 评论 681 浏览 评分:9.9
1017: [编程入门]完数的判断 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ int i, j, n, sum; cin >>…… 题解列表 2024年11月23日 0 点赞 0 评论 616 浏览 评分:10.0
普普通通的解题方法 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main (){ int n, j, a[1001],l; scanf("%d",&n); for ( j = 1; j …… 题解列表 2024年11月23日 1 点赞 0 评论 447 浏览 评分:0.0
最普通的解题方法 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int a,i,j,s; scanf("%d",&a); for(i=2;i<=a;i++) …… 题解列表 2024年11月13日 0 点赞 0 评论 417 浏览 评分:0.0
完数的判断C语言 摘要:解题思路:这个思路我都写在代码里了每段代表什么,如果有哪里不懂,欢迎评论区见注意事项:我用i*i<n是因为他因子一般成对出现,可以优化算法,让算法的运行速度更快参考代码:#include <stdio…… 题解列表 2024年11月06日 3 点赞 0 评论 816 浏览 评分:10.0
旧物有情 # vector枚举法完数的判断 ```#include#includeusingnamespacestd;intmain(){//N的因子:可以整除N的数//1236可以整除N,所以其都是6的因子intN;cin>>N;for(inti=2;i 题解列表 2024年10月10日 0 点赞 0 评论 523 浏览 评分:9.9
无聊的星期六 摘要:解题思路:注意事项:参考代码:N=int(input()) for z in range(6,N): if z % 10 == 6 or z % 10 == 8: num…… 题解列表 2024年09月09日 0 点赞 0 评论 951 浏览 评分:0.0
十分简单,一看就会 摘要:参考代码:#include<stdio.h>int main(){ int n,k=0; int num,a[100]; scanf("%d",&n); for(int i=1;i<n;i++){ …… 题解列表 2024年08月14日 0 点赞 0 评论 451 浏览 评分:0.0
编写题解 1017: [编程入门]完数的判断 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int s(int n){ int ans=0; for(int i=1;i<n;i…… 题解列表 2024年08月06日 0 点赞 0 评论 759 浏览 评分:0.0
不使用数组,只用循环 **解题思路**不使用数组,首先使用一个循环遍历1到n的数。然后自定义一个函数来判断每一个数是不是完数,假如是,就返回1.假如不是,就返回0。在主函数的循环里,对函数的返回值进行判定,判定是完数,就再使用一个循环,将其因子输出。具体看代码注释```c#includeintfun(intn){intsu 题解列表 2024年07月29日 0 点赞 0 评论 474 浏览 评分:9.9