poj 1131 Octal Fractions

告别代码丢失!用Git+Gitee管理你的Keil5单片机项目(保姆级图文教程) 本文详细介绍了如何利用Git和Gitee高效管理Keil5单片机项目,解决嵌入式开发中的代码丢失问题。通过精准配置.gitignore文件、设计适合团队的协作流程以及搭建安全备份体系,开发者可以轻松实现版本控制,提升工作效率。特别针对Keil工程的特殊文件类型,提供了实用的过滤规则和操作技巧。 阅读详情

//poj 1131 Octal Fractions
/*
题意:八进制小数到十进制小数的转化
题解:(引用aoxboxcox的题解)以0.123为例
初始时:       0[8]=0[10]
两边加上3[8]: 3[8]=3[10]
两边除以8[10]:0.3[8]=0.375[10]
两边加上2[8]: 2.3[8]=2.375[10]
两边除以8[10]:0.23[8]=0.296875[10]
两边加上1[8]: 1.23[8]=1.296875[10]
两边除以8[10]:0.123[8]=0.162109375[10]

*/
#include <iostream>
#include <algorithm>
using namespace std;
const int inf = 1<<28;
const int size = 26;

char str[1000000];
int a[1000000]; //a[0]存包括个位的位数,a[1]存个位,a[2]以后存十分位,百分位。。。
int sum;
void div8()  //a[]/8
{
     for (int i=1;i<a[0];i++)
     {
         a[i+1]+=(a[i]%8)*10;
         a[i]/=8;
     }
     double res=a[a[0]]*1.0/8;
     a[a[0]]=(int)res;
     res-=a[a[0]];
     while (res!=0){
         res*=10;
         a[++a[0]]=(int)(res);
         res-=a[a[0]];
     }
   
}
int main()
{
    while (scanf("%s",str)!=EOF)
    {
          int len=strlen(str);
          memset(a,0,sizeof(a));
         
          a[0]=1;
          for (int i=len-1;i>=2;i--)
          {
              a[1]=str[i]-'0';
              div8();
          }
         
          printf("%s [8] = 0.",str);
          for (int i=2;i<=a[0];i++) printf("%d",a[i]);
          printf(" [10]/n");
    }
    system("pause");
    return 0;
   
}

飞腾UEFI配置GPIO—飞腾FT2000/4 (D2000/8) GPIO引脚配置及使用 讲解了在飞腾UEFI代码中如何添加GPIO配置相关代码,并以GPIO1_B0—B7为例,将这8个引脚配置为GPIO工作模式并默认输出低电平 阅读详情

相关推荐

道闸不自动落杆故障排查:从传感器原理到控制器调试全解析

在工业自动化和物联网系统中,传感器与控制器构成的闭环控制是保障设备可靠运行的核心。其基本原理是通过传感器采集环境状态,控制器依据预设逻辑做出决策并驱动执行器动作。这一技术价值在于实现了无人值守下的安全、高效自动化,广泛应用于智能交通、安防和智能楼宇等领域。以停车场道闸系统为例,其自动落杆功能高度依赖地感线圈与防砸雷达的协同。地感线圈作为触发单元,负责感知车辆接近;而防砸雷达则作为持续监测的安全单元,通过微波探测防砸区域内是否有障碍物,其信号是控制器执行落杆决策的关键依据。当系统出现车辆通过后闸杆不落的典型故

weixin_29190651的博客 318

poj1131 八进制小数转十进制 java

题目链接:http://poj.org/problem?id=1131 开始竟然逗比

653

NI USB-8506 LIN通讯配置全攻略:从驱动安装到NI MAX硬件检测

本文详细介绍了NI USB-8506设备的LIN通讯配置全流程,从驱动安装到NI MAX硬件检测。重点讲解了NI-CAN和NI-XNET驱动的安装避坑技巧,以及LIN通讯参数配置的实战经验,帮助用户快速掌握车载LIN总线通讯技术,提升工作效率。

weixin_29171087的博客 605

poj 1131进制转换

//POJ 1131 Octal Fractions 任意进制之间小数的转换 //给定一个八进制的小数题目要求你把它转换为十进制小数, //转换后小数的位数是转换前八进制小数位数的3倍且不输出末尾无意义的零(即后置零). // 我采用的方法是乘10然后对8取整(现在假设将p进制的小数转换为n进制,同样采用乘n取整:), //每转换一位,都必须从最低位s[len-1]开始至小数的最高位(即小数

相信技术的力量 1071

408——计算机组成原理(持续更新)

小数点前的0代表正数,1代表负数。

qq_55202378的博客 1732

QCC5125/QCC5144----LDAC 44.1K 48K 96K 192K 输出

QCC5125/QCC5144----LDAC 44.1K 48K 96K 192K 输出。而且还不需要license限制。

Alex_886的博客 1987

POJ 1131 Octal Fractions [高精度]

import java.math.BigDecimal; import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner cin = new Scanner(System.in); while (cin.hasNextLine()) { Stri

more time 462

3.1 计算机视觉的发展和卷积神经网络概要(百度架构师手把手带你零基础实践深度学习原版笔记系列)

3.1 计算机视觉的发展和卷积神经网络(百度架构师手把手带你零基础实践深度学习原版笔记系列) 概要 计算机视觉作为一门让机器学会如何去“看”的科学学科,具体的说,就是让机器去识别摄像机拍摄的图片或视频中的物体,检测出物体所在的位置,并对目标物体进行跟踪,从而理解并描述出图片或视频里的场景和故事,以此来模拟人脑视觉系统。因此,计算机视觉也通常被叫做机器视觉,其目的是建立能够从图像或者视频中“感知”信息的人工系统。 计算机视觉技术经过几十年的发展,已经在交通(车牌识别、道路违章抓拍)、安防(人脸闸机.

aiAI 694

POJ 1131

Octal Fractions Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 6295   Accepted: 3427 Description Fractions in octal (base 8) notation can be expressed exact

XMzhou的专栏 1050

2025华为od机试真题B卷【字符串计数匹配】Java&Go 实现

给你一个字符串str和整数k,返回满足以下条件的所有子字符串个数: 1.恰好包含k个字母。 2.数字0-9各出现至少一次。

MISAYAONE的博客 645

YOLO 系列专栏(二十九)YOLO26 × StarNet 轻量化涨点方案(CVPR 2024)轻量化、主干改进篇 | 星星卷积虽小,却蕴藏着巨大的高效潜力

StarNet 出自 CVPR 2024 轻量化主干网络工作,核心创新是,依靠逐元素乘法实现高阶特征融合,在几乎不增加参数量与 FLOPs 的前提下,大幅提升特征表达能力,天然适合等多任务统一建模。本文将 StarNet 完整替换 YOLO26 原有主干,保留 YOLO26 无 NMS 检测头与轻量化结构,实现,并提供。

qq_36130719的博客 414

POJ 1131-Octal Fractions(高精度)

题目链接:传送门 题意:小数八进制转成10进制。。BigDecimal水过去。。 import java.io.*; import java.util.*; import java.math.*; import java.text.*; public class Main { public static void main(String[] args) { Scanne

Orz~~Orz 1137

面试问题总结——关于YOLO系列(三)

接着上篇的的YOLO系列面试问题总结,加油,冲! 三.YOLOv3 1.YOLOv3主干网络BackBone——Darknet-53网络结构(因为有53个卷积层) (原论文中Darknet53的尺寸是在图片分类训练集上训练的,所以输入的图像尺寸是256x256,而在YOLOv3中输入尺寸是416×416)   ①上图中,Top-1 Accuracy和Top-5 Accuracy是指什么呢?区别在哪呢?   我们知道ImageNet有大概1000个分类,而模型预测某张图片时,会给出1000个按概率从高.

boss-dog 1万+

POJ 1131 Octal Fractions

题目大意: 注释代码: 无注释代码: 单词解释:

源代码 638

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

poj 1131Octal Fractions

/*解题报告:(0.75)8 = (7*8-1 * 5*8-2) = (0.953125)10 其中负号代理多少次方(0.75)8 = ((5/8 + 7)/8)*/#include #include using namespace std;const int MAX = 100;char szOctal[MAX];char szDest[MAX];in

Unimen的专栏 733

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

Octal Fractions POJ - 1131

https://cn.vjudge.net/problem/POJ-1131 package javaacm; import java.util.*; import java.io.*; import java.math.*; public class Main { static int mod=(int)1e9+7; public static void main(Stri...

newhonor 241

POJ 1131 Octal Fractions G++

#include <iostream> #include <string> #include <algorithm> using namespace std; string add(string x,string y) { string c; c.reserve(100); string a; a.reserve(100); string ...

woniupengpeng的专栏 406

POJ1131 Octal Fractions

1 #include<stdio.h> 2 #include<string.h> 3 char s[1000]; 4 int b[4000]; 5 int main() 6 { 7 int i,j,k,n,t,len; 8 while(~scanf("%s",s)){ 9 memset(b,0,sizeo...

weixin_34120274的博客 212

POJ 1131 Octal Fractions【高精度用java】

题意:给一个八进制的0-1之间的小数,现在要求它对应的十进制的小数。 思路:明显要用高精度实现进制转换,这里直接上java,常规思路搞定。

MartaYang的博客 577

poj 1131 Octal Fractions java

高精度题:继续水一水。用到的方法:1.BigDecimal.add(BigDecimal);2.BigDecimal.divide(BigDecimal);import java.math.BigDecimal;import java.util.Scanner;public class Main{public static void main(String[] args){Scanner cin=new Scanner(System.in);while(cin.hasNext()){String str=c

蛰伏神兽的专栏 954

poj1131 Octal Fractions

Octal Fractions Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 5354 Accepted: 2900 Description Fractions in octal (base 8) notation can be expressed exactly...

weixin_30457881的博客 147

POJ-1131 Octal Fractions【进制转换】

题目链接:http://poj.org/problem?id=1131 题目大意: 八进制小数转十进制小数。不能含有后导0 解题思路: 大数问题,JAVA果断水过。 去后导0的用地BigDecimal的stripTrailingZeros,然后使用toPlainString防止高精度数表示成科学计数法(意思就是转换成朴素的字符串) 代码如下: import jav

飘过的小牛 3215

Poj1131-Octal Fractions

Octal Fractions Time Limit:1000MS Memory Limit:10000K Total Submissions:6669 Accepted:3641 Description Fractions in octal (base 8) notation can be expressed exactly...

weixin_34384681的博客 112

POJ 1131 Octal Fractions 高精度小数+JAVA .

题目地址:http://poj.org/problem?id=1131 第一次JAVA 高精度 import java.util.*; import java.math.*; import java.text.*; import java.io.*; public class Main { public static void main(String[] args) { Scanner

BRCOCOLI的博客 365

POJ 1131 Octal Fractions——高精度

package main; import java.io.*; import java.util.*; import java.math.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(new BufferedInputStream(System.in));

hao_zong_yin的博客 521
上一篇: poj 1101 The Game
下一篇: poj 1147 Binary codes
birdforever
博客等级 码龄16年 4粉丝 83原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值