mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
28 lines
582 B
C++
28 lines
582 B
C++
|
#include <iostream>
|
||
|
#include <cstdio>
|
||
|
#include <cmath>
|
||
|
#include <cstring>
|
||
|
using namespace std;
|
||
|
int main()
|
||
|
{
|
||
|
int n,r;
|
||
|
scanf("%d",&n);
|
||
|
for(int i=1; i<=n; i++)
|
||
|
{
|
||
|
scanf("%d",&r);
|
||
|
printf("Case %d:\n",i);
|
||
|
for(int j=0; j <2 * r+1; j++)
|
||
|
{
|
||
|
for(int k=0; k<2 * r + 1; k++)
|
||
|
{
|
||
|
if( abs((j-r)*(j-r)+(k-r)*(k-r)-r*r+0.0)<=3 )
|
||
|
putchar('*');
|
||
|
else
|
||
|
putchar(' ');
|
||
|
}
|
||
|
puts("");
|
||
|
}
|
||
|
}
|
||
|
return 0;
|
||
|
}
|