/*
数学:暴力
*/
#include <cstdio>
#include <cmath>
#include <cstring>
using namespace std;
int main() {
#ifndef ONLINE_JUDGE
freopen("in.txt", "r", stdin);
#endif
int cnt = 0;
for(int i=2; i<100000000; i++) {
double k = sqrt((i+1.0)*i/2);
int n = k + 0.1;
if(abs(n-k) < 1e-9) {
printf("%10d%10d\n", n, i);
if(++cnt == 10) break;
}
}
return 0;
}
UVa 138 - Street Numbers
最新推荐文章于 2014-12-18 18:40:18 发布