zoukankan      html  css  js  c++  java
  • 数学 SCU 4436 Easy Math

    题目传送门

     1 /*
     2     数学题:当有一个数开根号后是无理数,则No
     3 */
     4 #include <cstdio>
     5 #include <algorithm>
     6 #include <cstring>
     7 #include <cmath>
     8 #include <vector>
     9 #include <iostream>
    10 #include <string>
    11 #include <map>
    12 #include <set>
    13 using namespace std;
    14 
    15 typedef long long ll;
    16 const int MAXN = 1e5 + 10;
    17 const int INF = 0x3f3f3f3f;
    18 
    19 bool ok(int x)
    20 {
    21     int y = sqrt (x);
    22     if (y * y == x)    return true;
    23     else    return false;
    24 }
    25 
    26 int main(void)        //SCU 4436    Easy Math
    27 {
    28     // freopen ("A.in", "r", stdin);
    29 
    30     int n;
    31     while (scanf ("%d", &n) == 1)
    32     {
    33         bool flag = true;
    34         for (int i=1; i<=n; ++i)
    35         {
    36             int x;    scanf ("%d", &x);
    37             if (!ok (x))    flag = false;
    38         }
    39 
    40         if (flag)    puts ("Yes");
    41         else    puts ("No");
    42     }
    43 
    44     return 0;
    45 }
    编译人生,运行世界!
  • 相关阅读:
    redis安装
    redis的使用场景和基本数据类型
    (传输层)tcp协议
    async/await
    Promise对象
    对称加密与非对称加密
    Js遍历数组总结
    HTTPS加密传输过程
    HTML节点操作
    Js的new运算符
  • 原文地址:https://www.cnblogs.com/Running-Time/p/4644697.html
Copyright © 2011-2022 走看看