3171 - 空心矩阵
如题,打印一个5*5的空心矩形。
Input
Output
Examples
Input
no input needed
Output
***** * * * * * * *****
Solution C
#include <stdio.h> #include <stdlib.h> int main() { printf("*****\n"); printf("* *\n"); printf("* *\n"); printf("* *\n"); printf("*****\n"); // system("pause"); return 0; }
Solution C++
#include<bits/stdc++.h> using namespace std; string n; int main() { //freopen(".in","r",stdin); //freopen(".out","w",stdout); cout<<"*****"<<endl<<"* "<<"*"<<endl<<"* "<<"*"<<endl<<"* "<<"*"<<endl<<"*****"; return 0; }