标签:under main ret ati space problem P20 i++ lan
题解做法:没有用把阶乘算出来就得出了答案( ⊙ o ⊙ )啊!神奇呢!
#include<iostream> #include<cstdio> using namespace std; int a[10001],n; int main() { scanf("%d",&n); for(int i=2;i<=n;i++) { int w=i; for(int j=2;j<=i;j++) while(w%j==0) { a[j]++; w=w/j; } } for(int i=1;i<=10000;i++) if(a[i]!=0) cout<<i<<" "<<a[i]<<endl; return 0; }
标签:under main ret ati space problem P20 i++ lan
原文地址:https://www.cnblogs.com/xrj1229/p/9235942.html