为何

wchzh objection 2024-08-04 11:26:03 3

#include <bits/stdc++.h> using namespace std; int main() { int a, b, d=0; cin >> a >> b ; if (d == 0) { for (int i = 1; i <= a; i++) { if (i == 1 || i == a) { for (int j = 1; j <= b; j++) { cout << ""; } cout << endl; } else { for (int j = 1; j <= b; j++) { if (j == 1 || j == b) { cout << ""; } else { cout << " "; } } cout << endl; } } } else { for (int i = 1; i <= a; i++) { for (int j = 1; j <= b; j++) { cout << "*"; } cout << endl; } } cout<<(a-2)2+b2; }

{{ vote && vote.total.up }}

共 1 条回复

root 站长

写在一起判断 if (i == 1 || i == a || j == 1 || j == b)