当前位置:网站首页>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");
}
}
}
}
结果:
边栏推荐
- Resolved EROR 1064 (42000): You have an error in. your SOL syntax. check the manual that corresponds to yo
- Discourse's Close Topic and Reopen Topic
- Discourse 的关闭主题(Close Topic )和重新开放主题
- 2022-08-09 第四小组 修身课 学习笔记(every day)
- DDR4内存条电路设计
- Waldom Electronics宣布成立顾问委员会
- prometheus学习5altermanager
- 【LaTex-错误和异常】\verb ended by end of line.原因是因为闭合边界符没有在\verb命令所属行中出现;\verb命令的正确和错误用法、verbatim环境的用法
- TF中的条件语句;where()
- SQL sliding window
猜你喜欢
Coordinate system in navigation and positioning
Shell:三剑客之awk
基于FPGA的FIR滤波器的实现(5)— 并行结构FIR滤波器的FPGA代码实现
Spatial Pyramid Pooling -Spatial Pyramid Pooling (including source code)
易观分析联合中小银行联盟发布海南数字经济指数,敬请期待!
SQL sliding window
EasyPlayer针对H.265视频不自动播放设置下,loading状态无法消失的解决办法
从苹果、SpaceX等高科技企业的产品发布会看企业产品战略和敏捷开发的关系
Tf中的平方,多次方,开方计算
PIXHAWK飞控使用RTK
随机推荐
MySQL使用GROUP BY 分组查询时,SELECT 查询字段包含非分组字段
公牛10-11德里克·罗斯最强赛季记录
ssh服务攻防与加固
easyrecovery15数据恢复软件收费吗?功能强大吗?
2022-08-10 第四小组 修身课 学习笔记(every day)
为什么我使用C#操作MySQL进行中文查询失败
Daily sql - judgment + aggregation
机器学习总结(二)
DDR4内存条电路设计
Discourse's Close Topic and Reopen Topic
2022-08-09 Group 4 Self-cultivation class study notes (every day)
接口测试的基础流程和用例设计方法你知道吗?
Pinduoduo api interface application example
tf中矩阵乘法
pytorch,numpy两种方法实现nms类间+类内
Implementation of FIR filter based on FPGA (5) - FPGA code implementation of parallel structure FIR filter
Taobao sku API interface (PHP example)
js判断图片是否存在
maxwell concept
Daily sql-seek the sum of successful investments in 2016