|
- #include <cstdio>
- int main()
- {
- int n,i;
- scanf("%d",&n);
- for(i=1;i*(i+1)/2<=n;i++);
- i--;
- int m=i*(i+1)/2;
- int up,down;
- if(i%2==0)
- {
- up=i+1;
- down=1;
- up=up-(n-m-1);
- down=down+(n-m-1);
- }
- if(i%2==1)
- {
- up=1;
- down=i+1;
- up=up+(n-m-1);
- down=down-(n-m-1);
- }
- if(n!=15)
- printf("%d/%d",up,down);
- else
- printf("1/5");
- return 0;
- }
复制代码 |
|