UVa12611 - Beautiful Flag

简介: UVa12611 - Beautiful Flag
#include <cstdio>#include <iostream>usingnamespacestd;
voidsolve(int);
intmain()
{
#ifndef ONLINE_JUDGEfreopen("e:\\uva_in.txt", "r", stdin);
#endifintt;
cin>>t;
for (inti=1; i<=t; i++) {
cout<<"Case "<<i<<":"<<endl;
intr;
cin>>r;
solve(r);
    }
return0;
}
voidsolve(intr)
{
doublelength=r*5;
doublewidth=length*3/5;
cout.precision(0);
cout<<fixed<<-length*9/20<<" "<<fixed<<width/2<<endl;
cout<<fixed<<length*11/20<<" "<<fixed<<width/2<<endl;
cout<<fixed<<length*11/20<<" "<<fixed<<-width/2<<endl;
cout<<fixed<<-length*9/20<<" "<<fixed<<-width/2<<endl;
}
目录
相关文章
|
7月前
codeforces 344B - Simple Molecules
题意就是给出3个原子的化学价,然后组成一个分子,要保证这个分子是稳定的,如果你还记得高中化学知识的话这个很容易理解,然后让你求出1-2 2-3 1-3 号原子之间有几条键, 这里我分别用ta tb tc 表示, 用数学的方法表示出来的话就是a = tc + tb; b = ta+tc; c = ta + tb;可能有多种情况,只要输出一种即可。
21 0
|
9月前
UVa1584 - Circular Sequence
UVa1584 - Circular Sequence
23 0
|
9月前
UVa 374 Big Mod
UVa 374 Big Mod
27 0
|
9月前
UVa343 What Base Is This
UVa343 What Base Is This
34 0
|
索引
Beautiful Matrix
Beautiful Matrix
57 0
Beautiful Matrix
|
Java C语言
HDOJ(HDU) 2139 Calculate the formula(水题,又一个用JavaAC不了的题目)
HDOJ(HDU) 2139 Calculate the formula(水题,又一个用JavaAC不了的题目)
78 0
|
Web App开发 PHP 索引
flag在index里(详解)——Bugku
刚刚做了bugku的题目,现在整理一下 写出解题思路,希望能够帮助到那些需要帮助的人 所有的wp都是以一题一篇的形式写出 主要是为了能够让读者更好的阅读以及查找, 希望你们不要责怪!!共勉!!!   Challenge 1152 Solves flag在index里 80   http://120.
2695 0
|
人工智能
poj2356:Find a multiple
题目链接: 【鸽巢原理+乱搞】 其实用不着开$map$ 一步最巧妙的转化是$……$前缀和。 反正本宝宝突发奇想就出来了。 首先,我们分类讨论。 1.当$∃i \in N_{+} $ 且 $i \in [1,n]$ 使 $a_{i} | n$ 则直接选这个数就好 2.没有以上那种特殊情况的话,我们记录前缀和$sum_{i}= \sum _{k=1}^{i} a_{k} (mod \ \ n)$ 然后又有两种情况。
1149 0