|
发表于 2022-4-17 16:56:41
|
显示全部楼层
#include<iostream>
using namespace std;
int main()
{
int arr[5][5] = {{1},
{-1,1},
{1,1,1},
{7,-8,9,10},
{11,12,-13,14,15}};
for(int i = 0; i < 5; i++)
{
for(int j = 0; j < 5; j++)
{
if(arr[i][j]!=0)
cout <<"*";
}
cout << endl;
}
return 0;
} |
|