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

Codeforces Round 925 (Div. 3) 1931D. Divisible Pairs Solution

    Problem Link  :   https://codeforces.com/contest/1931/problem/D S olution in C++: /// Author : AH_Tonmoy #include < bits / stdc ++. ...

Powered by Blogger.