题解 | #素数个数#
素数个数
http://www.nowcoder.com/practice/0116caa1942d4bb48ada409a320b95a4
- 关键是我们题意要转换过来,其实题目描述中就有答案。
- 计算过程要等价过来。
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,x;
while(cin>>n){
vector<long long> arr;
for(int i=0; i< n;i++){
cin>>x;
arr.push_back(x);
}
long long count = 0;
for(int i =0;i < n;i++){
count+= arr[i]/2;
}
cout<<count<<endl;
}
return 0;
} 大厂笔试题题解 文章被收录于专栏
主要是公司笔试题得一些总结

