当前位置:网站首页>1091 N-Defensive Number (15 points)
1091 N-Defensive Number (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 n = scan.nextInt();
//
for(int i = 0; i < n;i++) {
int num = scan.nextInt();
boolean flag = true;
for (int j = 1; j < 10; j++) {
String s = j * num * num + "";
//Determine if the input string ends
if (s.endsWith(num+"")){
System.out.println(j + " " + s);
flag = false;
break;
}
}
if (flag){
System.out.println("No");
}
}
}
}
结果:
边栏推荐
猜你喜欢
详述 MIMIC护理人员信息表(十五)
1036 跟奥巴马一起编程 (15 分)
关于Excel实现分组求和最全文档
1056 组合数的和 (15 分)
TF通过feature与label生成(特征,标签)集合,tf.data.Dataset.from_tensor_slices
从何跟踪伦敦金最新行情走势?
SQL sliding window
如何选择专业、安全、高性能的远程控制软件
ROS 话题通信理论模型
【latex异常和错误】Missing $ inserted.<inserted text>You can‘t use \spacefactor in math mode.输出文本要注意特殊字符的转义
随机推荐
1003 我要通过 (20 分)
Pytorch模型转ONNX模型
联想集团:2022/23财年第一季度业绩
2022-08-09 第四小组 修身课 学习笔记(every day)
Service的两种启动方式与区别
Unity3D learning route?
ROS 话题通信理论模型
2022年中国软饮料市场洞察
tf中矩阵乘法
1071 小赌怡情 (15 分)
Discourse's Close Topic and Reopen Topic
PIXHAWK飞控使用RTK
Pico neo3在Unity中的交互操作
Activity的四种启动模式
How to choose professional, safe and high-performance remote control software
【Pytorch】nn.ReLU(inplace=True)
A used in the study of EEG ultra scanning analysis process
redis操作
Go语言实现Etcd服务发现(Etcd & Service Discovery & Go)
常见激活函数及其导数