当前位置:网站首页>1101 How many times B is A (15 points)
1101 How many times B is A (15 points)
2022-08-11 07:47:00 【dumb bit】
题目要求:
代码:
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));
}
}
结果:
边栏推荐
- redis操作
- 详述 MIMIC护理人员信息表(十五)
- 2022-08-09 Group 4 Self-cultivation class study notes (every day)
- 李沐d2l(十)--卷积层Ⅰ
- 从 dpdk-20.11 移植 intel E810 百 G 网卡 pmd 驱动到 dpdk-16.04 中
- 博途PLC 1200/1500PLC ModbusTcp通信梯形图优化汇总(多服务器多从站轮询)
- Taobao product details API interface
- Redis源码-String:Redis String命令、Redis String存储原理、Redis字符串三种编码类型、Redis String SDS源码解析、Redis String应用场景
- 恒源云-Pycharm远程训练避坑指南
- Redis源码:Redis源码怎么查看、Redis源码查看顺序、Redis外部数据结构到Redis内部数据结构查看源码顺序
猜你喜欢
随机推荐
Depth (relay supervision)
Activity的四种状态
SQL滑动窗口
oracle19c不支持实时同步参数,请教一下大佬们有什么好的解决办法吗?
1061 判断题 (15 分)
国密规范 SM2 SM3 SM4
1051 复数乘法 (15 分)
年薪40W测试工程师成长之路,你在哪个阶段?
NFT 的价值从何而来
1002 写出这个数 (20 分)
Unity底层是如何处理C#的
Go语言实现Etcd服务发现(Etcd & Service Discovery & Go)
CIKM 2022 AnalytiCup Competition: 联邦异质任务学习
【LeetCode每日一题】——682.棒球比赛
李沐d2l(十)--卷积层Ⅰ
mysql视图与索引
动态代理学习
第一个C函数:如何实现板级初始化?
Pinduoduo API interface
tf.cast(),reduce_min(),reduce_max()