UVA 12611 - Beautiful Flag

Solve in C:

#include<stdio.h>
int main()
{

    int i,n,r,x1,x11,y1,y11,x2,x22,y2,y22,w,l;
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {
        scanf("%d",&r);
        l=r*5.0;
        w=(l*6)/10.0;
        x1=-1*(.45*l);
        y1=w*.5;
        x11=l*.55;
        y11=w*.5;
        x2=l*.55;
        y2=-1*(w*.5);
        x22=-1*(.45*l);
        y22=-1*(w*.5);
        printf("Case %d:\n%d %d\n%d %d\n%d %d\n%d %d\n",i,x1,y1,x11,y11,x2,y2,x22,y22);
    }
}


No comments

Most View Post

Recent post

RESTful APIs with CRUD Operations in Laravel 12| (2025)

  RESTful APIs serve as the foundation of modern web development. They follow a set of rules called Representational State Transfer (REST) t...

Powered by Blogger.