当前位置:网站首页>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源码:Redis源码怎么查看、Redis源码查看顺序、Redis外部数据结构到Redis内部数据结构查看源码顺序
- 接口测试的基础流程和用例设计方法你知道吗?
- pytorch,numpy两种方法实现nms类间+类内
- Resolved EROR 1064 (42000): You have an error in. your SOL syntax. check the manual that corresponds to yo
- ssh服务攻防与加固
- 2022年中国软饮料市场洞察
- Go语言实现Etcd服务发现(Etcd & Service Discovery & Go)
- 【Pytorch】nn.ReLU(inplace=True)
- 语音信号处理:预处理【预加重、分帧、加窗】
- 【Pytorch】nn.PixelShuffle
猜你喜欢
随机推荐
tf中矩阵乘法
恒源云-Pycharm远程训练避坑指南
tf中自减操作;tf.assign_sub()
1071 小赌怡情 (15 分)
Unity3D 学习路线?
那些事情是用Unity开发项目应该一开始规划好的?如何避免后期酿成巨坑?
MindManager2022全新正式免费思维导图更新
从 dpdk-20.11 移植 intel E810 百 G 网卡 pmd 驱动到 dpdk-16.04 中
Amazon API interface Daquan
Unity游戏排行榜的制作与优化
技术分享 | 实战演练接口自动化如何处理 Form 请求?
2022-08-09 Group 4 Self-cultivation class study notes (every day)
1046 划拳 (15 分)
2022-08-10 Group 4 Self-cultivation class study notes (every day)
redis操作
Shell:三剑客之awk
基于FPGA的FIR滤波器的实现(4)— 串行结构FIR滤波器的FPGA代码实现
DDR4内存条电路设计
1076 Wifi密码 (15 分)
网络电话软件或迎整顿 “免费”通话须迈安全关