W - Bitset(第二季水)
Description
Input
Output
Sample Input
Sample Output
#include<iostream>
using namespace std;
void f(double n)
{
int i,j,k,a[],p=;
double t;
k=n;
t=n-k;
if(k==)cout<<;
while(k){
if(k%==)a[p++]=;
else a[p++]=;
k=k/;
}
for(i=p-;i>=;i--)cout<<a[i];
if(t){
cout<<".";
while(){
t*=;
if(t>=){
cout<<;
if(t==)break;
else t-=;
}
else cout<<;
}
}
cout<<endl;
}
int main()
{
double n;
while(cin>>n){
f(n);
}
//system("pause");
return ;
}
W - Bitset(第二季水)的更多相关文章
- F - The Fun Number System(第二季水)
Description In a k bit 2's complement number, where the bits are indexed from 0 to k-1, the weight o ...
- D - Counterfeit Dollar(第二季水)
Description Sally Jones has a dozen Voyageur silver dollars. However, only eleven of the coins are t ...
- N - Robot Motion(第二季水)
Description A robot has been programmed to follow the instructions in its path. Instructions for the ...
- S - 骨牌铺方格(第二季水)
Description 在2×n的一个长方形方格中,用一个1× 2的骨牌铺满方格,输入n ,输出铺放方案的总数. 例如n=3时,为2× 3方格,骨牌的铺放方案有三种, ...
- R - 一只小蜜蜂...(第二季水)
Description 有一只经过训练的蜜蜂只能爬向右侧相邻的蜂房,不能反向爬行.请编程计算蜜蜂从蜂房a爬到蜂房b的可能路线数. 其中,蜂房的结构如下所示. ...
- I - Long Distance Racing(第二季水)
Description Bessie is training for her next race by running on a path that includes hills so that sh ...
- Y - Design T-Shirt(第二季水)
Description Soon after he decided to design a T-shirt for our Algorithm Board on Free-City BBS, XKA ...
- B - Maya Calendar(第二季水)
Description During his last sabbatical, professor M. A. Ya made a surprising discovery about the old ...
- T - 阿牛的EOF牛肉串(第二季水)
Description 今年的ACM暑期集训队一共有18人,分为6支队伍.其中有一个叫做EOF的队伍,由04级的阿牛.XC以及05级的COY组成.在共同的集训生活中,大家建立了深厚的 ...
随机推荐
- C#验证类 可验证:邮箱,电话,手机,数字,英文,日期,身份证,邮编,网址,IP (转)
namespace YongFa365.Validator { using System; using System.Text.RegularExpressions; /**//// <summ ...
- ExtJS 饼状图报表
简单的ExtJS饼状图报表. 先上源码,咱再慢慢解析: Ext.onReady(function(){ var store = Ext.create('Ext.data.JsonStore', { f ...
- (原+转)ubuntu16中安装opencv2.4.11
转载请注明出处: http://www.cnblogs.com/darkknightzh/p/5638117.html 参考网址: http://www.cnblogs.com/jeakon/arch ...
- No1_4.数组的基本操作_Java学习笔记
import java.util.Arrays; public class HelloArrayOp { public static void main(String[] args) { // TOD ...
- 几项有用的JQUERY代码
检测IE浏览器 在进行CSS设计时,IE浏览器对开发者及设计师而言无疑是个麻烦.尽管IE6的黑暗时代已经过去,IE浏览器家族的人气亦在不断下滑,但我们仍然有必要对其进行检测.当然,以下片段亦可用于检测 ...
- js智能提示代码
<reference path = "../../../Scripts/jQuery-1.4.1.js"/>
- [TYVJ] P1030 乳草的入侵
乳草的入侵 背景 Background USACO OCT09 6TH 描述 Description Farmer John一直努力让他的草地充满鲜美多汁的而又健康的牧草.可惜天不从人愿,他在植物 ...
- 分析java 嵌套类与内部类
一.什么是嵌套类及内部类? 可以在一个类的内部定义另一个类,这种类称为嵌套类(nested classes),它有两种类型:静态嵌套类和非静态嵌套类.静态嵌套类使用很少,最重要的是非静态嵌套类 ...
- linux下mysql连接jar包的位置在哪里?
linux下连接mysql数据库,肯定也会用到驱动jar包. 该jar包应该被置于jdk安装路径下jre文件夹lib目录的ext文件夹下.例如我的JDK安装路径为/usr/java/jdk1.6.0_ ...
- Android SDK更新缓慢或无法更新的解决方法
windows 解决方法就是修改C:\Windows\System32\drivers\etc\hosts文件.添加一行: 74.125.237.1 dl-ssl.google.com l ...