当前位置:网站首页>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");
}
}
}
}
结果:
边栏推荐
- matplotlib
- NTT的Another Me技术助力创造歌舞伎演员中村狮童的数字孪生体,将在 “Cho Kabuki 2022 Powered by NTT”舞台剧中首次亮相
- Multiscale communication in cortical-cortical networks
- radix-4 FFT principle and C language code implementation
- 技能在赛题解析:交换机防环路设置
- 【LeetCode每日一题】——844.比较含退格的字符串
- A used in the study of EEG ultra scanning analysis process
- sql--Users who have purchased more than 3 times (inclusive) within 7 days (including the current day), and the purchase amount in the past 7 days exceeds 1,000
- Daily sql--statistics the total salary of employees in the past three months (excluding the latest month)
- ROS 话题通信理论模型
猜你喜欢
随机推荐
NTT的Another Me技术助力创造歌舞伎演员中村狮童的数字孪生体,将在 “Cho Kabuki 2022 Powered by NTT”舞台剧中首次亮相
2022-08-10 第四小组 修身课 学习笔记(every day)
TF中的条件语句;where()
JD.com product details API call example explanation
基于FPGA的FIR滤波器的实现(4)— 串行结构FIR滤波器的FPGA代码实现
机器学习总结(二)
radix-4 FFT principle and C language code implementation
docker安装mysql5.7(仅供测试使用)
Get Pinduoduo product information operation details
国密规范 SM2 SM3 SM4
How Unity handles C# under the hood
tf中矩阵乘法
JVM学习——3——数据一致性
matplotlib
关于Android Service服务的面试题
Unity底层是如何处理C#的
Unity开发者必备的C#脚本技巧
Amazon Get AMAZON Product Details API Return Value Description
Amazon API interface Daquan
微信小程序功能上新(2022.06.01~2022.08.04)