码迷,mamicode.com
首页 > 其他好文 > 详细

No.16 sqrt函数问题

时间:2016-12-04 20:14:27      阅读:136      评论:0      收藏:0      [点我收藏+]

标签:i++   ble   float   定义   include   sqrt   pause   stdio.h   加载   

#include "stdio.h"
#include "math.h"
#include "stdlib.h"
void main()
{
float i,x,y;
for (i=1;i<100000;i++)
{x=sqrt(i+100);
y=sqrt(i+168);
if(x*x==i+100&&y*y==i+168)
printf("\n%.2f\n",i);
}
system("pause");
}

 

1.加载"math.h"库文件;

2.double/float sqrt(double/float);

3.必须先定义参数才能使用。

No.16 sqrt函数问题

标签:i++   ble   float   定义   include   sqrt   pause   stdio.h   加载   

原文地址:http://www.cnblogs.com/cxr1234/p/6131316.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!