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 971 (Div. 4) 2009C. The Legend of Freya the Frog Solution

  Problem Link    https://codeforces.com/contest/2009/problem/C S olution in C++: /// Author : AH_Tonmoy #include < bits / stdc ++. h &g...

Powered by Blogger.