欢迎光临散文网 会员登陆 & 注册

[代码展示]刷题刷题

2019-11-09 14:49 作者:kands-code  | 我要投稿

import java.util.*;


 // Compiler version JDK 11.0.2


 class Dcoder

 {

   public static void main(String []args)

   { 

    Scanner in = new Scanner(System.in);

    int ac = in.nextInt();

    long[] A = new long[ac];

    for(int i = 0;i < ac;i++){

      A[i] = in.nextLong();

    }

    for(int j = 0;j < ac;j++){

      for(long i = 1;i < 10000;i++){

        if(A[j] == Math.pow(i,i)){

          System.out.print("Yes ");

          break;

        }else if(i == 9999){

          System.out.print("No ");

        }

      }

    }

   }

 }


[代码展示]刷题刷题的评论 (共 条)

分享到微博请遵守国家法律