当前位置:首页 > 数学课件 > 正文内容

能穷举函数空间的函数吗?如何表示这些函数?如欧几空间里的点用数对来表示

zhao_admin1年前 (2022-05-31)数学课件38

#include using namespace std; class point { public: point( ) { } point( float x, float y ); float get_x( ); float get_y( ); point operator++( ); point operator++( int a ); point operator--( ); point operator--( int a ); private: float v_x; float h_y; }; point::point( float x,float y ) : v_x( x ), h_y( y ) { } float point::get_x( ) { return v_x; } float point::get_y( ) { return h_y; } point point::operator++ ( ) { if( v_x 0 || v_x > 639 || h_y 0 || h_y > 479 ); else { v_x += 1; h_y += 1; } return *this; } point point::operator++ ( int a ) { if( v_x 0 || v_x > 639 || h_y 0 || h_y > 479 ); else { point temp( v_x, h_y ); v_x += 1; h_y += 1; return temp; } return *this; } point point::operator-- ( ) { if( v_x 1 || v_x > 640 || h_y 1 || h_y > 480 ); else { v_x -= 1; h_y -= 1; } return *this; } point point::operator-- ( int a ) { if( v_x 1 || v_x > 640 || h_y 1 || h_y > 480 ); else { point temp( v_x, h_y ); v_x -= 1; h_y -= 1; return temp; } return *this; } int main( ) { float a, b; cout > a >> b; point p( a, b ); int i; for( i = 0; i

扫描二维码推送至手机访问。

版权声明:本文由PPT写作技巧发布,如需转载请注明出处。

本文链接:http://www.ppt3000.com/post/66245.html

分享给朋友:

相关文章