acgo题库
  • 首页
  • 题库
  • 学习
  • 天梯
  • 备赛

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

    • GESP
    • CPA
    • 电子学会考级
  • 竞赛
  • 讨论
  • 团队
  • 商城
登录
注册
题目详情提交记录(0)
  • 题解

    #include <bits/stdc++.h> using namespace std; int main() { int n,z; cin>>n; z=(n+1)/2;//日中间的一横; for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ if(j1||jn)cout<<"|"; else if(i1||in||i==z)cout<<"-"; else cout<<"x"; } cout<<endl; } return 0; }

    userId_undefined
    153****1913
    19阅读
    0回复
    0点赞
  • 题解

    #include <bits/stdc++.h> using namespace std; int main() { int n,x; cin >> n; x = (n+1)/2; for(int i = 1;i <= n;i++){ for(int j = 1;j <= n;j++){ if(j1 || jn){ cout << "|"; } else if(i == 1 || i == n || i == x){ cout << "-"; } else{ cout << "x"; } } cout << endl; } return 0; }

    userId_undefined
    宇博AC(求关注)
    倔强青铜
    9阅读
    0回复
    0点赞
  • 解题(简单)

    #include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ if(j1||jn){ cout<<"|"; }else if(i1||in||i==n/2+1){ cout<<"-"; }else{ cout<<"x"; } } cout<<endl; } return 0; }

    userId_undefined
    宣锝
    7阅读
    0回复
    0点赞
  • 题解

    userId_undefined
    屿°
    空间掌握者循环·循环打卡人
    0阅读
    0回复
    0点赞
暂无数据

提交答案之后,这里将显示提交结果~

首页