当前位置:网站首页>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));
}
}
结果:
边栏推荐
猜你喜欢
go-grpc TSL认证 解决 transport: authentication handshake failed: x509 certificate relies on ... ...
Trill keyword search goods - API
Tensorflow中使用tf.argmax返回张量沿指定维度最大值的索引
李沐d2l(十)--卷积层Ⅰ
关于Excel实现分组求和最全文档
1076 Wifi密码 (15 分)
详述MIMIC 的ICU患者检测时间信息表(十六)
Douyin API interface
【Pytorch】nn.PixelShuffle
【Pytorch】nn.Linear,nn.Conv
随机推荐
maxwell concept
1003 我要通过 (20 分)
TF中的One-hot
Unity开发者必备的C#脚本技巧
docker安装mysql5.7(仅供测试使用)
梅科尔工作室——BP神经网络
2022-08-09 Group 4 Self-cultivation class study notes (every day)
Activity的四种状态
Tf中的平方,多次方,开方计算
ROS 服务通信理论模型
pytorch,numpy两种方法实现nms类间+类内
2022-08-10 第四小组 修身课 学习笔记(every day)
【LeetCode每日一题】——682.棒球比赛
Service的两种启动方式与区别
Tensorflow中使用tf.argmax返回张量沿指定维度最大值的索引
Tidb二进制集群搭建
CIKM 2022 AnalytiCup Competition: 联邦异质任务学习
break pad源码编译--参考大佬博客的总结
【LeetCode每日一题】——844.比较含退格的字符串
opencv实现数据增强(图片+标签)平移,翻转,缩放,旋转