当前位置:网站首页>Hangdian oj2092 integer solution
Hangdian oj2092 integer solution
2022-07-07 14:14:00 【sinat_ thirty-six million seven hundred and eighty-nine thousan】
Write it down first , I don't know why I can't pass
#include<iostream>
#include<math.h>
using namespace std;
int main(){
int a,b;
bool cc;
while(cin>>a>>b){
cc=true;
if(b==0&&a==0){
exit(0);
}
if(b>0){
for(int i=1;i<=pow(b,0.5);i++){
if(b%i==0){
if(i+b/i==a){
cout<<"Yes"<<endl;
cc=false;
break;
}
}
}
if(cc){
cout<<"No"<<endl;
}
}else if(b==0){
cout<<"Yes"<<endl;
}else{
b=-1*b;
for(int i=1;i<=pow(b,0.5);i++){
if(b%i==0){
if(-1*i+b/i==a||-1*b/i+i==a){
cout<<"Yes"<<endl;
cc=false;
break;
}
}
}
if(cc){
cout<<"No"<<endl;
}
}
}
}
边栏推荐
- FCOS3D label assignment
- Is the spare money in your hand better to fry stocks or buy financial products?
- Social responsibility · value co creation, Zhongguancun network security and Information Industry Alliance dialogue, wechat entrepreneur Haitai Fangyuan, chairman Mr. Jiang Haizhou
- Regular expression integer positive integer some basic expressions
- oracle 触发器实现级联更新
- Seven propagation behaviors of transactions
- Realization of search box effect [daily question]
- 接口自动化测试-接口间数据依赖问题解决
- 高等数学---第八章多元函数微分学1
- AutoCAD - how to input angle dimensions and CAD diameter symbols greater than 180 degrees?
猜你喜欢
Hands on Teaching: XML modeling
118. Yanghui triangle
Supply chain supply and demand estimation - [time series]
高等数学---第八章多元函数微分学1
Advanced Mathematics - Chapter 8 differential calculus of multivariate functions 1
常用数字信号编码之反向不归零码码、曼彻斯特编码、差分曼彻斯特编码
gvim【三】【_vimrc配置】
手把手教会:XML建模
Redis can only cache? Too out!
Vmware共享主机的有线网络IP地址
随机推荐
Build a secure and trusted computing platform based on Kunpeng's native security
IP address home location query
Mathématiques avancées - - chapitre 8 différenciation des fonctions multivariables 1
Verilog implementation of a simple legv8 processor [4] [explanation of basic knowledge and module design of single cycle implementation]
requires php ~7.1 -&gt; your PHP version (7.0.18) does not satisfy that requirement
PC端页面如何调用QQ进行在线聊天?
Wired network IP address of VMware shared host
Is the compass stock software reliable? Is it safe to trade stocks?
Data flow diagram, data dictionary
bashrc与profile
Vscode configuration uses pylint syntax checker
C # switch pages through frame and page
ES日志报错赏析-Limit of total fields
Excerpt from "misogyny: female disgust in Japan"
FCOS3D label assignment
Advanced Mathematics - Chapter 8 differential calculus of multivariate functions 1
118. Yanghui triangle
最长上升子序列模型 AcWing 482. 合唱队形
Dry goods | summarize the linkage use of those vulnerability tools
How to check the ram and ROM usage of MCU through Keil