当前位置:网站首页>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;
}
}
}
}
边栏推荐
- 【网络安全】sql注入语法汇总
- What are the principles for distinguishing the security objectives and implementation methods that cloud computing security expansion requires to focus on?
- Environment configuration of lavarel env
- The meaning of variables starting with underscores in PHP
- Best practice | using Tencent cloud AI willingness to audit as the escort of telephone compliance
- Reverse non return to zero code, Manchester code and differential Manchester code of common digital signal coding
- Advanced Mathematics - Chapter 8 differential calculus of multivariate functions 1
- Redis 核心数据结构 & Redis 6 新特性详
- 最长上升子序列模型 AcWing 1012. 友好城市
- Details of redis core data structure & new features of redis 6
猜你喜欢
SSRF vulnerability file pseudo protocol [netding Cup 2018] fakebook1
AI人才培育新思路,这场直播有你关心的
2022-7-7 Leetcode 34. Find the first and last positions of elements in a sorted array
使用day.js让时间 (显示为几分钟前 几小时前 几天前 几个月前 )
用例图
常用数字信号编码之反向不归零码码、曼彻斯特编码、差分曼彻斯特编码
最长上升子序列模型 AcWing 1012. 友好城市
2022-7-6 Leetcode 977. Square of ordered array
手把手教会:XML建模
Vmware 与主机之间传输文件
随机推荐
Oracle advanced (V) schema solution
股票开户首选,炒股交易开户佣金最低网上开户安全吗
Advanced Mathematics - Chapter 8 differential calculus of multivariate functions 1
FCOS3D label assignment
Reverse non return to zero code, Manchester code and differential Manchester code of common digital signal coding
Excerpt from "misogyny: female disgust in Japan"
mysql ”Invalid use of null value“ 解决方法
gvim【三】【_vimrc配置】
带你掌握三层架构(建议收藏)
Sliding rail stepping motor commissioning (national ocean vehicle competition) (STM32 master control)
Use day JS let time (displayed as minutes, hours, days, months, and so on)
Dry goods | summarize the linkage use of those vulnerability tools
Redis 核心数据结构 & Redis 6 新特性详
How does MySQL control the number of replace?
FCOS3D label assignment
oracle 非自动提交解决
Selenium库
Help tenants
Is the spare money in your hand better to fry stocks or buy financial products?
PostgreSQL array type, each splice