题解:P10508 质因子
Zjb_nhzx_2021 · · 题解
P10508 质因子 题解
一看文件(numlist.txt),发现其竟然有
重点:我们需要开 long long!
但其实除了重点之外,这道题也没什么算法了。
对于每个数
#include<bits/stdc++.h>
using namespace std;
int s;
int main(){
for(int i=1;i<=1000;i++){
long long a;
scanf("%lld",&a);
while(a%2==0){
a=a/2;
s++;
}
}
printf("%d",s);
return 0;
}
::::
在 Dev-C++ 里编译运行之后输出了
Python 直接输出就能 AC 了
print(251)