题解 | #约数之和#
约数之和
https://ac.nowcoder.com/acm/problem/22196
#include<stdio.h>
int n,s=1;
int main(){
scanf("%d",&n);
for(int i=2;i<=n;i++) if(!(n%i)) s+=i;
printf("%d",s);
}
题解 文章被收录于专栏
https://ayx.moefox.tech/
约数之和
https://ac.nowcoder.com/acm/problem/22196
#include<stdio.h>
int n,s=1;
int main(){
scanf("%d",&n);
for(int i=2;i<=n;i++) if(!(n%i)) s+=i;
printf("%d",s);
}
https://ayx.moefox.tech/
相关推荐