标签:== cpp div img 阶乘 cout ret solution png

不难
class Solution {
public:
int clumsy(int N) {
int i;
if(N==3) return 6;
if(N==2||N==1) return N;
int a=N*(N-1)/(N-2)+N-3;
N-=4;
int sign=1;
long long res=a;
if(N==0) return a;
while(N>=4){
a=N*(N-1)/(N-2)-N+3;
res-=a;
N-=4;
cout<<-a<<endl;
}
//if(N<=0) return res;
if(N==3){
return res-6;
}
res-=N;
return res;
}
};
标签:== cpp div img 阶乘 cout ret solution png
原文地址:https://www.cnblogs.com/hyffff/p/14606737.html