3170 - 矩形五星
打印5*5的星号矩阵,形成一个星号组成的矩形。(长方形和正方形统称矩形)
Input
Output
Examples
Input
***** ***** ***** ***** *****
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); for(int i=1;i<=4;i++) cout<<"*****"<<endl; cout<<"*****"; return 0; }