当前位置:网站首页>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));
}
}
结果:
边栏推荐
- When MySQL uses GROUP BY to group the query, the SELECT query field contains non-grouping fields
- 国密规范 SM2 SM3 SM4
- 【Pytorch】nn.Linear,nn.Conv
- Pytorch模型转ONNX模型
- Pinduoduo API interface (attach my available API)
- JD.com product details API call example explanation
- daily sql - query for managers and elections with at least 5 subordinates
- 【推荐系统】:协同过滤和基于内容过滤概述
- Trill keyword search goods - API
- 技能在赛题解析:交换机防环路设置
猜你喜欢

Redis测试

Taobao API common interface and acquisition method

【latex异常和错误】Missing $ inserted.<inserted text>You can‘t use \spacefactor in math mode.输出文本要注意特殊字符的转义

ROS 话题通信理论模型

Douyin API interface

MySQL使用GROUP BY 分组查询时,SELECT 查询字段包含非分组字段

DDR4内存条电路设计

Daily sql--statistics the total salary of employees in the past three months (excluding the latest month)

语音信号处理:预处理【预加重、分帧、加窗】

SQL sliding window
随机推荐
李沐d2l(十)--卷积层Ⅰ
【推荐系统】:协同过滤和基于内容过滤概述
Cobbleland 博览会 基础系列 1
下一代 无线局域网--强健性
TF通过feature与label生成(特征,标签)集合,tf.data.Dataset.from_tensor_slices
从 dpdk-20.11 移植 intel E810 百 G 网卡 pmd 驱动到 dpdk-16.04 中
接口测试的基础流程和用例设计方法你知道吗?
第一个C函数:如何实现板级初始化?
LeetCode brushing series -- 46. Full arrangement
opencv实现数据增强(图片+标签)平移,翻转,缩放,旋转
Depth (relay supervision)
Shell:三剑客之awk
6月各手机银行活跃用户较快增长,创半年新高
Discourse's Close Topic and Reopen Topic
JD.com product details API call example explanation
Pico neo3 Unity打包设置
2021-08-11 for循环结合多线程异步查询并收集结果
计算YUV文件的PSNR与SSIM
When MySQL uses GROUP BY to group the query, the SELECT query field contains non-grouping fields
A used in the study of EEG ultra scanning analysis process