当前位置:网站首页>1091 N-自守数 (15 分)
1091 N-自守数 (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 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 + "";
//判断是不是以輸入字符串结尾
if (s.endsWith(num+"")){
System.out.println(j + " " + s);
flag = false;
break;
}
}
if (flag){
System.out.println("No");
}
}
}
}
结果:
边栏推荐
- Taobao product details API interface
- 2022年中国软饮料市场洞察
- How do you optimize the performance of your Unity project?
- Tensorflow中使用tf.argmax返回张量沿指定维度最大值的索引
- 【软件测试】(北京)字节跳动科技有限公司二面笔试题
- Daily sql - judgment + aggregation
- 为什么C#中对MySQL不支持中文查询
- 【@网络工程师:用好这6款工具,让你的工作效率大翻倍!】
- MySQL使用GROUP BY 分组查询时,SELECT 查询字段包含非分组字段
- Unity底层是如何处理C#的
猜你喜欢
opencv实现数据增强(图片+标签)平移,翻转,缩放,旋转
How to choose professional, safe and high-performance remote control software
buu—Re(5)
Multiscale communication in cortical-cortical networks
结合均线分析k线图的基本知识
Taobao product details API interface
《猪猪1984》NFT 作品集将上线 The Sandbox 市场平台
PIXHAWK飞控使用RTK
Taobao sku API interface (PHP example)
Resolved EROR 1064 (42000): You have an error in. your SOL syntax. check the manual that corresponds to yo
随机推荐
技能在赛题解析:交换机防环路设置
TF中的四则运算
Redis测试
How do you optimize the performance of your Unity project?
DDR4内存条电路设计
How Unity handles C# under the hood
Implementation of FIR filter based on FPGA (5) - FPGA code implementation of parallel structure FIR filter
Discourse 的关闭主题(Close Topic )和重新开放主题
Resolved EROR 1064 (42000): You have an error in. your SOL syntax. check the manual that corresponds to yo
Attitude solution - gyroscope + Euler method
TF中的One-hot
js判断图片是否存在
【Pytorch】nn.Linear,nn.Conv
Pinduoduo api interface application example
1688 product interface
Daily sql--statistics the total salary of employees in the past three months (excluding the latest month)
js根据当天获取前几天的日期
【sdx62】XBL设置共享内存变量,然后内核层获取变量实现
Taobao sku API interface (PHP example)
NTT的Another Me技术助力创造歌舞伎演员中村狮童的数字孪生体,将在 “Cho Kabuki 2022 Powered by NTT”舞台剧中首次亮相