poj 百练 2765(基础题)有难度
来源:互联网 发布:数据库设计文档实例 编辑:程序博客网 时间:2024/05/21 09:07
感觉这道题有点难度
如果单纯换算成整数,记录变量值的长度是不够的
double 真是牛X 跟我想的不一样啊
注意printf
里面 % m.n g
printf格式控制真心麻烦
别人写的这个很不错
double真心好
#include <stdio.h>#include <string.h>int main(){ int i;//freopen("F:\\input.txt","r",stdin );while(1) { char n[20]; if(scanf("%s",n)==EOF) break; int len = strlen(n); double n10=0; for( i=len-1;n[i]!='.';i--) { n10/=double(8.0); n10+=double(n[i]-'0'); } n10/=double(8.0);// .那位少除了一次 for( i=0;i<len;i++) printf("%c",n[i]); printf(" [8] = %.45g [10]\n",n10); } return 0;}
- poj 百练 2765(基础题)有难度
- poj 百练2972(基础题)
- poj 百练(2735)基础题
- poj 百练2974(基础题)
- poj 百练2744( 基础题)
- poj 百练2975(基础题)
- poj 百练 2743(基础题)
- poj 百练 2976(基础题)
- poj 百练 2819(基础题)
- poj 百练2820(基础题)
- poj 百练 2797(基础题)
- poj 百练2973(基础题)
- poj 百练2734(基础题)
- poj 百练 2798(基础题)
- poj 百练 2742(基础题)
- poj 百练2799(基础题)
- C语言I/O小结 poj百练2804字典(基础题)
- poj 百练 2765 八进制小数(精度问题)
- 控件介绍_LinkLabel控件的主要常用链接属性LinkArea
- 连表查询时" (+) "的神奇作用~!
- 关于shell脚本编程的10个最佳实践
- Vm下设置系统显示全屏
- 29 掌握业务领域知识
- poj 百练 2765(基础题)有难度
- jfreechart 饼形图 显示数据精确度
- operator=(LONG);报 "error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int"的处理方法
- oracle表空间操作详解
- hdu1086
- 菜鸟学堂 -【Java 定时器 二 -Quartz 】
- ASP.NET 常用方法类 - PageBase 页面基类
- UITableView不显示数据
- android 开发环境的搭建 Eclipse SDK jdk ADT