当前位置:网站首页>1101 B是A的多少倍 (15 分)
1101 B是A的多少倍 (15 分)
2022-08-11 06:45:00 【呆比特】
题目要求:
代码:
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int num = scan.nextInt();
int n = scan.nextInt();
//准备
String str = num + "";
int length = str.length();
//拼接
String right = str.substring(length - n);
String left = str.substring(0,length-n);
str = right + left;
double result = (double)Integer.valueOf(str) / num;
//倍数
System.out.print(String.format("%.2f",result));
}
}
结果:
边栏推荐
- MySQL 版本升级心得
- jar服务导致cpu飙升问题-带解决方法
- NTT的Another Me技术助力创造歌舞伎演员中村狮童的数字孪生体,将在 “Cho Kabuki 2022 Powered by NTT”舞台剧中首次亮相
- 【sdx62】XBL设置共享内存变量,然后内核层获取变量实现
- Implementation of FIR filter based on FPGA (5) - FPGA code implementation of parallel structure FIR filter
- Resolved EROR 1064 (42000): You have an error in. your SOL syntax. check the manual that corresponds to yo
- easyrecovery15数据恢复软件收费吗?功能强大吗?
- 线程交替输出(你能想出几种方法)
- 公牛10-11德里克·罗斯最强赛季记录
- Taobao sku API interface (PHP example)
猜你喜欢
随机推荐
ssh服务攻防与加固
Daily sql-statistics of the number of professionals (including the number of professionals is 0)
语音信号处理:预处理【预加重、分帧、加窗】
Pinduoduo api interface application example
你是如何做好Unity项目性能优化的
Find the shops that have sold more than 1,000 yuan per day for more than 30 consecutive days in the past six months
接口测试的基础流程和用例设计方法你知道吗?
daily sql - query for managers and elections with at least 5 subordinates
关于Android Service服务的面试题
博途PLC 1200/1500PLC ModbusTcp通信梯形图优化汇总(多服务器多从站轮询)
微信小程序功能上新(2022.06.01~2022.08.04)
Daily sql-employee bonus filtering and answer rate ranking first
Do not add the is prefix to the variables of the boolean type in the POJO class of the Alibaba specification
Taobao API interface reference
为什么我使用C#操作MySQL进行中文查询失败
常见激活函数及其导数
进制转换间的那点事
Redis源码:Redis源码怎么查看、Redis源码查看顺序、Redis外部数据结构到Redis内部数据结构查看源码顺序
Shell:三剑客之awk
exness:黄金1800关口遇阻,静待美国CPI出炉