HDU 4218 IMBA?

http://acm.hdu.edu.cn/showproblem.php?pid=4218

不用删最后的空格,fuck

View Code
#include <stdio.h>
#include <math.h>

int main()
{
    int t,r,a;
    int i,j;
    int nCase=1;
    scanf("%d",&t);
    while(t--)
    {
        scanf("%d",&r);
        a=2*r+1;
        printf("Case %d:\n",nCase++);
        for(i=0;i<a;i++)
        {
            for(j=0;j<a;j++)
                if(fabs((i-r)*(i-r)+(j-r)*(j-r)-r*r+0.0)<=3)
                    putchar('*');
                else
                    putchar(' ');
            putchar('\n');
        }
    }
    return 0;
}
原文地址:https://www.cnblogs.com/xiaohongmao/p/2452722.html