c++的一道题目

第3题怎么写
2025-05-08 19:45:38
推荐回答(1个)
回答1:

#include
using namespace std;
int main()
{
int N,S,PS,x,y;
cout<<"\nInput N,S,PS:"<while(cin>>N>>S>>PS)
{
for(x=1;x<=N;x++)
{
for(y=1;y<=N;y++)
if(x+y==N*(N+1)/2 - S && x*x+y*y==N*(N+1)*(2*N+1)/6 - PS)
{
if(xcout<}
}
cout<<"\nInput next N,S,PS:"<}
return 0;
}