Cut Integer

PAT-1132

#include<iostream>
#include<cstring>
#include<string>
#include<algorithm>
#include<cstdio>
#include<sstream>
#include<cstdlib>
using namespace std;
int main(){
int n;
cin>>n;
while(n--){
int z;
cin>>z;
stringstream ss;
ss<<z;
string now=ss.str();
int len=now.length();
string a=now.substr(0,len/2);
string b=now.substr(len/2,len);
int sa=stoi(a);
int sb=stoi(b);
if(sa*sb==0){
cout<<"No"<<endl;
continue;
} if(z%(sa*sb)==0)
cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
return 0;
}

PAT-1132(Cut Integer )数的拆分+简单题的更多相关文章

  1. PAT 1132 Cut Integer[简单]

    1132 Cut Integer(20 分) Cutting an integer means to cut a K digits lone integer Z into two integers o ...

  2. PAT 1132 Cut Integer

    1132 Cut Integer (20 分)   Cutting an integer means to cut a K digits lone integer Z into two integer ...

  3. pat 1132 Cut Integer(20 分)

    1132 Cut Integer(20 分) Cutting an integer means to cut a K digits lone integer Z into two integers o ...

  4. PAT Advanced 1132 Cut Integer (20) [数学问题-简单数学]

    题目 Cutting an integer means to cut a K digits long integer Z into two integers of (K/2) digits long ...

  5. 树状数组例题-数星星,简单题easy,校门外的树2,清点人数

    [例1]数星星 天空中有一些星星,这些星星都在不同的位置,每个星星都有个坐标,如果一个星星的左下方(包括正左和正下)有k颗星星,就说这颗星星是k级的. 比如,上图中,星星5是3级的(1,2,4在其左下 ...

  6. PAT 甲级 1132 Cut Integer

    https://pintia.cn/problem-sets/994805342720868352/problems/994805347145859072 Cutting an integer mea ...

  7. PAT A1132 Cut Integer (20 分)——数学题

    Cutting an integer means to cut a K digits lone integer Z into two integers of (K/2) digits long int ...

  8. 1132. Cut Integer (20)

    Cutting an integer means to cut a K digits long integer Z into two integers of (K/2) digits long int ...

  9. 1132 Cut Integer

    题意:略. 思路:注意除数可能为0的情况,不然会导致浮点错误. 代码: #include <iostream> #include <string> using namespac ...

随机推荐

  1. 【noi 2.6_9290】&【poj 2680】Computer Transformation(DP+高精度+重载运算符)

    题意:给一个初始值1,每步操作将1替换为01,将0替换为10.问N步操作后有多少对连续的0. 解法:f[i]表示第i步后的答案.可以直接打表发现规律--奇数步后,f[i]=f[i-1]*2-1;偶数步 ...

  2. LINUX - 获取本地ip

    Linux编程获取本机IP地址的几种方法 参考: https://blog.csdn.net/zhongmushu/article/details/89944990 https://www.cnblo ...

  3. haproxy 2.2代理后端https服务

    globalmaxconn 100000chroot /usr/local/haproxystats socket /var/lib/haproxy/haproxy.sock mode 600 lev ...

  4. gradle中的build script详解

    目录 简介 project和task 一个例子 task详细讲解 task脚本 task依赖 动态task 默认task build script的外部依赖 gradle中的build script详 ...

  5. how to input special symbol in macOS

    how to input special symbol in macOS 如何在 macOS 中输入特殊符号 1024 ≈ 1000 2^10 == 1024 约等于 1000, 方便用来表示 Opt ...

  6. 使用 Canvas 实现一个类似 Google 的可视化的页面错误反馈库

    使用 Canvas 实现一个类似 Google 的可视化的页面错误反馈库 iframe 嵌套 iframe iframe 包含 复制的 HTML 页面 和支持可以拖拽的工具栏 鼠标经过上面,智能识别 ...

  7. Python Quiz & Python Exercise

    Python Quiz & Python Exercise https://www.w3schools.com/quiztest/quiztest.asp?qtest=PYTHON https ...

  8. 如何关闭 iPad Pro 自动开启 wifi 和蓝牙

    如何关闭 iPad Pro 自动开启 wifi 和蓝牙 为了省电,明明关闭了,但是发现每天都会自动开启,什么鬼设计 https://support.apple.com/zh-cn/HT208086 h ...

  9. bili & library bundler

    bili & library bundler https://bili.egoist.sh/#/#quick-start # Node.js 8 or above: $ npm i -D bi ...

  10. Flutter & QRCode App

    Flutter & QRCode App https://github.com/xgqfrms/qrcode-reader-app how to open android emulator o ...