- 龙凤苑中学A班考试
我家的门牌号
- @ 2024-6-19 17:16:47
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, sum=0, j=1;
cin >> n;
for (int i=1; ; i++)
{
sum += i;
for (j=1; j<=i; j++)
{
if (sum-j-j-j == n)
{
cout << j << " " << i;
break;
}
}
if (sum-j-j-j == n)
break;
}
return 0;
}
0 comments
No comments so far...