Cantor表 题解
2025-06-25 17:57:34
发布于:北京
0阅读
0回复
0点赞
嗯,其实也不用二分
#include <bits/stdc++.h>
using namespace std;
int main(){
int n,x=1;
cin>>n;
while (n-x>0){
n-=x;//n表示第几个
x++;//x表示第几行(斜着的)
}
if (x%2==1){
cout<<x+1-n<<'/'<<n;
}
else{
cout<<n<<'/'<<x+1-n;
}
return 0;
}
这里空空如也
有帮助,赞一个