1、这个取每一位数的写法很常见,一般是10进制的数,所以mod或/10,如果是与26字母相关的,那么mod或/,所以要灵活运用。
bool juge(int n){
while(n){
int temp=n%10;
//if(temp==2 || temp==0 || temp==1 || temp==9){
return true;
}
n/=10;
}
return false;
}
2、结果取几位小数
cout<<fixed<<setprecision(n)<<sum<<endl;