c语言中rint函数 怎么调用,我的为啥说未定义呢。
POJ1133 STARS:#include <iostream>
#include <math.h>
#include <algorithm>
using namespace std;
const double eps=1e-8;
int so,mo,br;
inline void transform(const point &a,const point &b,const point &c,const point &d,const poly &w,const poly &z,bool type){
double x1=b.x-a.x,y1=b.y-a.y,x2=d.x-c.x,y2=d.y-c.y,s=x2*x2+y2*y2,u=(x1*x2+y1*y2)/s,v=(x2*y1-x1*y2)/s,tx,ty;
int sum=0,x,y;
for(int i=0;i<z.n;i++){
x=z.p[i].x-c.x,y=z.p[i].y-c.y;
tx=(double)(u*x-v*y+a.x),ty=(double)(v*x+u*y+a.y);
x=rint(tx),y=rint(ty);
if(dcmp(tx-(double)x)||dcmp(ty-(double)y))return;
bool f=1;
for(int j=0;f&&j<w.n;j++)
if(w.p[j].x==x&&w.p[j].y==y){
f=0;
tem.p[i]=w.p[j];
sum+=w.p[j].z;
}
if(f)return;
}