测评会员优惠活动进行中 · 开通 VIP,有效期内测评不限次 VIP 优惠中 · 测评不限次 立即查看

A22581. # include< bits/ stdc++. h> using namespace std; int n; int f1(int n){ int res=0; for(int i=2;1<=n;1+=2){ int j=i; while(j%2==0) res++; j/=2; } return res; } int f2(int n){ int res=0; while(n){ n/=5;…

判断题 较易

题目描述

# include< bits/ stdc++. h>
using namespace std;
int n;
int f1(int n){
    int res=0;
	for(int i=2;1<=n;1+=2){
	    int j=i;
	    while(j%2==0)
	        res++;
	        j/=2;

    }
    return res;
}
int f2(int n){
    int res=0;
    while(n){
        n/=5;
	    res+=n;
    }
     return res;
}
int main(){
    cin>>n;
    cout<< min(f1(n),f2(n));
    return 0;
}

保证输入的 n不超过105,完成下面的判断题和单选题:

将第8行的 j%2==0 改为 !(j&1) 程序功能不变。( )

选项(单选)

上一题 下一题