PAT 1073 Scientific Notation

IB网络下不同租户业务隔离方案 IB(InfiniBand)网络隔离可以在不同的通信模式下实现,其中包括 IPoIB(IP over InfiniBand)通信模式。在 IPoIB 模式下,InfiniBand 网络可以承载 IP 数据包,使得基于 IP 的应用程序能够在 InfiniBand 网络上进行通信。在这种情况下,IB 网络隔离通常指通过配置 Partition Key(PKey)来实现不同的租户或应用程序之间的网络隔离。然而,IB 网络隔离并不仅限于 IPoIB 模式。 阅读详情

Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation matches the regular expression [+-][1-9]"."[0-9]+E[+-][0-9]+ which means that the integer portion has exactly one digit, there is at least one digit in the fractional portion, and the number and its exponent's signs are always provided even when they are positive.

Now given a real number A in scientific notation, you are supposed to print A in the conventional notation while keeping all the significant figures.

Input Specification:

Each input file contains one test case. For each case, there is one line containing the real number A in scientific notation. The number is no more than 9999 bytes in length and the exponent's absolute value is no more than 9999.

Output Specification:

For each test case, print in one line the input number A in the conventional notation, with all the significant figures kept, including trailing zeros,

Sample Input 1:
+1.23400E-03
Sample Output 1:
0.00123400
Sample Input 2:
-1.2E+10
Sample Output 2:
-12000000000

解题思路:
   简单的字符串处理题,输入格式固定,只需根据阶数与小数长度的关系判断是否补零。

#include<stdio.h>

#include<string.h>
int main()
{
    int i,j,cnt=0,sum=0,len;
    char num[100000],temp[100000],sign_n,sign_e,neg='-';
    scanf("%s",num);len=strlen(num);
    sign_n=num[0];
    for(i=1,j=0;i<len;i++)
    {
        
        if(num[i]=='E')
            break;
        if(i!=2)
            temp[j++]=num[i];
        if(i>2)cnt++;
    }
    if(sign_n==neg)
        putchar(neg);
    sign_e=num[++i];
    while(num[++i]==48&&i<len);
    for(;i<len;i++)
        sum=sum*10+(num[i]-48);
    if(sign_e==neg)
    {
        putchar(48);
        putchar('.');
        while(--sum)putchar(48);
        printf("%s",temp);
    }
    else
    {
        if(cnt>sum)
        {
            for(i=0;i<=sum;i++)
                putchar(temp[i]);
            putchar('.');
            for(;i<=cnt;i++)
                putchar(temp[i]);
        }
        else
        {
            //printf("sum=%d cnt=%d\n",sum,cnt);
            printf("%s",temp);
            for(i=1;i<=sum-cnt;i++)
                putchar(48);
        }
    }
    putchar('\n');
    return 0;
}
Python遥感图像处理应用篇(二十三):Python+GDAL 批量拼接图像 遥感影像拼接分多种不同的情况,比如比较常用的是两幅影像拼接或者多个图像合并为一个图像。GDAL中实现影像拼接的方式也有多种,比如常用可以通过numpy读取影像数组,并计算各个图像的numpy数组范围,合并多个numpy数组为一个最终的结果,并将其重新输出为一幅新的图像,即可实现图像的拼接。另外比较方便的一种方法便是使用GDAL.warp()函数方法。这个函数的功能很多,可以实现多种不同的目的,比如用于坐标系转换、投影变换、图像合并与镶嵌、地理范围裁剪、更改分辨率、矢量裁剪等多种功能。这些功能可以通过设置Op 阅读详情

相关推荐

【Ultrascale+ MPSOC学习记录】6、从eMMC启动翻车

因为MPSOC还有一种启动模式是eMMC,接下来咱就实现从eMMC启动。

ryo891012的博客 474

【PAT甲级 - C++题解】1073 Scientific Notation

📣专栏定位:为想考甲级PAT的小伙伴整理常考算法题解,祝大家都能取得满分!

Newin2020的博客 392

2023西工大NOJ (C语言版) 完结!!!

代码均可AC,不含解析。

annesede的博客 8万+

PAT:A1073 Scientific Notation (20 分)

PAT:A1073 Scientific Notation (20 分) Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation matches the regular expression [+-][1-9].[0-9]...

Ecloss 233

Android GNSS 可视卫星星空图/卫星天顶图 原理及画法介绍

目录1 概念介绍2 绘制步骤2.1 获取卫星信息2.2 绘制底图 效果图: 1 概念介绍 首先介绍一下方位角和高度角的概念: 方位角:是从某点的指北(地理北极)方向线起,依顺时针方向到目标方向线之间的水平夹角。 高度角:从一点至观测目标的方向线与水平面间的夹角。 卫星天顶图 即是根据每一颗卫星的方位角和高度角将其画在以观测位置为中心的天顶图上。 天顶图其底图为由外向内的三个圆和四条直线。三个圆由外向内依次代表高度角0°、30°、60°,中心点代表90°;四条直线分别表示正北-正南、东北-西南、正东

x1471898145的博客 1万+

Silvaco TCAD仿真例库——肖特基二极管反向击穿特性(案例)

本文详细解析了使用Silvaco TCAD仿真例库进行肖特基二极管反向击穿特性分析的完整案例。通过构建包含浮空P型保护环的平面结构,重点阐述了针对雪崩击穿仿真的关键步骤,包括高精度网格划分、碰撞电离模型(impact selb)的启用以及反向电压的精细扫描策略。文章深入探讨了漂移区掺杂浓度、保护环设计等参数对击穿电压的影响,并提供了实用的调试心得,旨在帮助工程师精准预测和优化功率肖特基二极管的反向耐压能力。

fire9的博客 724

PAT甲级 1073 Scientific Notation

PAT甲级 1073 Scientific Notation 题目链接 Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation matches the regular expression [±][1-9].[0-9]+E[±][0-9]+ which means that the integer portion has exactl

旺崽的博客 2585

Java与OSG的梦幻联动:深入编译OpenSceneGraph的Java JNI桥梁,开启3D视觉盛宴的奇幻之旅

🔥关注墨瑾轩,带你探索编程的奥秘!🚀🔥超萌技术攻略,轻松晋级编程高手🚀🔥技术宝库已备好,就等你来挖掘🚀🔥订阅墨瑾轩,智趣学习不孤单🚀🔥即刻启航,编程之旅更有趣🚀在编译OpenSceneGraph (OSG) 的Java版本时,首先需要了解OSG本身是一个主要用于3D图形和视觉仿真的开源库,它主要支持C++。然而,OSG 也支持通过JNI(Java Native Interface)与Java集成,这允许Java程序调用OSG的C++库。

java专栏 869

PAT 1073 Scientific Notation

Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation matches the regular expression [+-][1-9].[0-9]+E[+-][0-9]+ which means that the inte...

静下心来做事 248

动态规划之【树形DP】第3课:树形DP应用案例实践2

动态规划之【树形DP】第3课:树形DP应用案例实践2

王老师青少年编程 763

把 ABAP ALE Change Pointers 讲透:从 CDHDR/CDPOS 到 BDCP2,再到 RBDMIDOC 的自动分发链路

摘要:SAP ALE Change Pointers机制在系统集成中实现业务变更与数据分发的解耦。它记录业务对象变更(如SAP主数据修改),但不立即发送,而是由后续分发逻辑决定发送时机和方式。该机制包含两层:Change Documents记录审计级变更明细,Change Pointers标记需分发的关键变更。配置核心包括全局开关、消息类型激活和字段选择。典型应用如零售价格条件变更自动推送至POS系统,通过BDCP2表存储待处理队列,由RBDMIDOC程序定时评估生成IDoc。运维需关注定期清理和性能优化,

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 209

PAT——1073 Scientific Notation 甲级

1073 Scientific Notation题目AC代码(参考)参考 题目 https://pintia.cn/problem-sets/994805342720868352/problems/994805395707510784 AC代码(参考) #include<bits/stdc++.h> using namespace std; int main() { string s; cin>>s; int posE=s.find('E'); string t=s.subs

ljhsq的博客 640

把 SAP Fiori Launchpad 配置文件放进 MIME Repository:从上传、缓存控制到可访问路径的完整实践

文章摘要: 在 SAP Fiori 项目中,Launchpad 配置文件的部署是关键挑战,核心在于通过 MIME Repository 而非直接修改标准文件来实现稳定配置。与 BSP Repository 相比,MIME Repository 支持显式设置客户端缓存时间(如 SAP 推荐的 7 天),适合生产环境治理。配置文件需为 JSON 格式,部署时需确保路径可访问(通过 ICF node 和 external alias),并注意语法错误会导致静默失效。实操步骤包括:在 SE80 中创建专用目录、设置

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 92

[PAT-A 1073]Scientific Notation

题目大意:以科学计数法表示以一个实数A,按普通输出A,并保证所有有效位都保留,包括末尾的0。 思路: 1.以字符串方式读入给出的实数A,保存在数组str中。(编号从0开始) 2.str[0]为符号位,照原样输出。str[1]为A的第一位数字,str[2]中为小数点。 3.定位E的位置,记录在int型变量pos中,从str[1]开始遍历字符串,直到str[pos] == ‘E’。 4.计算指数。s...

RegulusF的博客 278

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

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

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

PAT 甲级 1073  Scientific Notation

1073 Scientific Notation (20 point(s)) Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation matches the regular expression [+-][1-9].[0-...

漫浸天空的雨色的备忘录~ 594

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

PAT1073 Scientific Notation

原文:我的个人博客 原题链接 1073 Scientific Notation 思路   简单的字符串操作。不过要细心一点。n保存E后面的字符串所对应的数字,t保存E前面的字符串,不包括符号位。当n小于0时表示向前移动,那么先输出0. 然后输出abs(n)-1个0,然后继续输出t中的所有数字;当n>0时候表示向后移动,那么先输出第一个字符,然后将t中尽可能输出n个字符,如果t已经输出...

我是没有梦想的小白 172

PAT 1073 Scientific Notation

1073Scientific Notation(20分) Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation matches the regular expression [+-][1-9].[0-9]+E[+-]...

YIU 147

PAT --1073 Scientific Notation

作者:柳婼 来源:优快云 原文:https://blog.youkuaiyun.com/liuchuo/article/details/52121350 参考这位大佬实现的,具体思路是用num保存E前面的字符串所对应的数字,exp保存E后面的字符串,不包括符号位。当exp&lt;0时表示小数点向前移动,那么先输出0. 然后输出abs(exp)-1个0,然后继续输出num中的所有数字;当exp&gt;0时候...

上帝是个娘们的博客 186

pat 1073. Scientific Notation

原题链接:https://www.patest.cn/contests/pat-a-practise/1073              1073. Scientific Notation (20) 时间限制 100 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序

messenger的博客 338

PAT 1073 Scientific Notation python解法

1073 Scientific Notation (20 分) Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation matches the regular expression [±][1-9].[0-9]+E[±][0...

qq_36936510的博客 371

浙大 PAT 甲级 1073 Scientific Notation

我太难了… 没有用string,而是用的C风格的字符串去写,本来就很麻烦了……然后有一个隐蔽地方有点逻辑错误,看了一晚上没有看出来,要不就是超时要不就是段错误,弄得我都迷茫了…太傻了,看了几个小时之后终于看出了。 #include<stdio.h> #include<stdlib.h> #include<memory.h> using namespace ...

qq_39115541的博客 199

PAT 甲 1073 Scientific Notation

Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation matches the regular expression [±][1-9].[0-9]+E[±][0-9]+ which means that the intege...

S-L-L-Q的博客 173
上一篇: PAT 1010. Radix (25)
下一篇: PAT 1003 Emergency
chamsu
博客等级 码龄14年 78粉丝 32原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值