当前位置:网站首页>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");
}
}
}
}
结果:
边栏推荐
猜你喜欢
随机推荐
Service的两种状态形式
为什么我使用C#操作MySQL进行中文查询失败
无服务器+域名也能搭建个人博客?真的,而且很快
MindManager2022全新正式免费思维导图更新
网络电话软件或迎整顿 “免费”通话须迈安全关
求职简历这样写,轻松搞定面试官
prometheus学习4Grafana监控mysql&blackbox了解
1051 复数乘法 (15 分)
Douyin share password url API tool
1101 B是A的多少倍 (15 分)
JD.com product details API call example explanation
1096 大美数 (15 分)
2022年中国软饮料市场洞察
Redis源码-String:Redis String命令、Redis String存储原理、Redis字符串三种编码类型、Redis String SDS源码解析、Redis String应用场景
【Pytorch】nn.PixelShuffle
How Unity programmers can improve their abilities
【深度学习】什么是互信息最大化?
break pad源码编译--参考大佬博客的总结
Resolved EROR 1064 (42000): You have an error in. your SOL syntax. check the manual that corresponds to yo
radix-4 FFT principle and C language code implementation








