记忆面包之C语言-常用库函数

1、判断是否为平方数

#include <stdio.h>
#include <math.h>
int main()
{
  int a;
  scanf("%d",&a);
  if(sqrt(a)==(int)sqrt(a))  //sqrt()平方根函数
    printf("Y");
  else
    printf("N");
  return 0;

}

C语言常用函数库http://c.biancheng.net/c/ref/list_288_2.html

发布了10 篇原创文章 · 获赞 1 · 访问量 190

猜你喜欢

转载自blog.csdn.net/weixin_39475542/article/details/104553980