U E D R , A S I H C RSS

몸짱프로젝트/Invert

C version

  • 개발자 : 나휘동


~cpp 
typedef poly * poly_ptr
struct poly{
	int coef;
	int expon;
	poly_ptr link;
};

...

poly_ptr invert(poly_ptr p)
{
	poly_ptr front, middle;
	/*front = p;
	middle = front->link;
	p = middle->link;
	front->link = NULL;
	middle->link = front;*/
	middle = NULL;
	while(p){
		front = middle;
		middle = p;
		p = p->link;
		middle->link = front;
	}
	return middle;
}

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:29:28
Processing time 0.0110 sec