- Cantor表
- 2017-01-31 09:58:18 @
// C语言
#include<stdio.h>
int main(){
int n;
scanf("%d",&n);
int x=0,y=0;
int j=1;
for (int i=0;i<n-1;i++){
if ((x==0)&&(y%2==0)){y++,j=0;continue;}
if ((x==0)&&(y%2)){y--,x++;continue;}
if ((y==0)&&(x%2)){x++,j=1;continue;}
if ((y==0)&&(x%2==0)){y++,x--;continue;}
else {
if (j) x--,y++;
else x++,y--;
}
}
printf("%d/%d",++x,++y);
return 0;
}
0 条评论
目前还没有评论...