[Login|Register]
New post

Show post

Search forum

Read post
what's wrong [ Topic ] 2011-07-04 20:43:23 sadhen
#include<stdio.h>
#include<math.h>
int isit(long n){
    long a;
    a=(long ) sqrt(n);
    if(a*a==n)
        return 1;
    return 0;
}
int main(){
    long n;
    
    scanf("%ld",&n);
    while(n!=-1){
        if(isit(n))
            printf("YES\n");
        else
            printf("NO\n");
        scanf("%ld",&n);
    }
    return 0;
}
//在自己的电脑上测试并打印0-10^9中的完全平方数,没有什么不对啊
Reply
Title
Message
(64K)
University of Science and Technology of China
Online Judge for ACM/ICPC
Processed in 2.4ms with 2 query(s).