| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
哪位大牛帮我看看1969, 实在不知道哪有错!!!!#include <iostream>
using namespace std;
void main() {
int i, in;
long sum, t;
while(cin >> t) {
if(cin.eof())
break;
if(t <= 0 )
continue;
sum = 0;
i = 1;
cout <<"TERM " << t << " IS ";
while(sum < t){
sum += i;
i++;
}
in = t + i - 1 - sum;
if(i % 2 == 1)
cout << in << '/' << i - in << endl;
else
cout << i - in << '/' << in << endl;
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator