当前位置:首页 > 编程笔记 > 正文
已解决

P1014 [NOIP1999 普及组] Cantor 表

来自网友在路上 165865提问 提问时间:2023-10-08 01:20:58阅读次数: 65

最佳答案 问答题库658位专家为你答疑解惑

#include <bits/stdc++.h>
using namespace std; 
int main() {int n,k=1;cin>>n;while (n>k) {n=n-k;k++;}if(k%2==0) cout<<n<<"/"<<(k+1-n);else cout<<k+1-n<<"/"<<n;return 0;
} 

 

查看全文

99%的人还看了

猜你感兴趣

版权申明

本文"P1014 [NOIP1999 普及组] Cantor 表":http://eshow365.cn/6-17039-0.html 内容来自互联网,请自行判断内容的正确性。如有侵权请联系我们,立即删除!