宣锘


私信TA

用户名:dotcpp0696410

访问量:68

签 名:

等  级
排  名 5875
经  验 1441
参赛次数 11
文章发表 3
年  龄 0
在职情况 学生
学  校
专  业

  自我简介:

解题思路:无

注意事项:无,就是有点nan.

参考代码:

#include <bits/stdc++.h>


using namespace std;

typedef long long ll;

const int N =1000;

ll a[N][N];

int main()

{

ll n,x,y;

cin>>n>>x>>y;

for(int j=1;j<=n;j++)

    cout<<'('<<x<<','<<j<<')'<<' ';

    cout <<endl;

for(int j=1;j<=n;j++)

    cout<<'('<<j<<','<<y<<')'<<' ';

    cout <<endl;

for(int i=1;i<=n;i++)

    for(int j=1;j<=n;j++)

    if(i-j==x-y)

    cout<<'('<<i<<','<<j<<')'<<' ';

    cout<<endl;

for(int i=1;i<=n;i++)

    for(int j=1;j<=n;j++)

    if(i+j==x+y)

    cout<<'('<<j<<','<<i<<')'<<' ';

    cout<<endl;

    return 0;

}


 

0.0分

1 人评分

  评论区