1968. [AHOI2005]约数研究【数论】
生活随笔
收集整理的這篇文章主要介紹了
1968. [AHOI2005]约数研究【数论】
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
Description
Input
只有一行一個(gè)整數(shù) N(0 < N < 1000000)。Output
只有一行輸出,為整數(shù)M,即f(1)到f(N)的累加和。Sample Input
3Sample Output
5
?
http://blog.csdn.net/aarongzk/article/details/50647495
?
1 #include<iostream> 2 #include<cstdio> 3 using namespace std; 4 int n,ans; 5 int main() 6 { 7 scanf("%d",&n); 8 for(int i=1; i<=n; i++) 9 ans+=n/i; 10 printf("%d\n",ans); 11 }轉(zhuǎn)載于:https://www.cnblogs.com/refun/p/8682441.html
總結(jié)
以上是生活随笔為你收集整理的1968. [AHOI2005]约数研究【数论】的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 面向对象--内部属性类型
- 下一篇: Centos7 Java8的安装