Output a plane point about the x axis y axis and the point of symmetry of the origin

Source: Internet
Author: User
* * Copyright and Version Statement of the program: * Copyright (c) 2011, Computer College of Yantai University * All rights reserved. * File name: Test.cpp * Author: Li Xinpeng * Completion Date: March 4, 2014 * Version number: v1.0 * Description of task and solution: * Input Description: No * Problem description: Find a plane point about X axis y  
  
Axis and Origin symmetrical point * Program output: Symmetric point * problem analysis: slightly * algorithm design: Slightly * * #include <iostream> using namespace std;  
Enum SYMMETRICSTYLE{AXISX, Axisy, point};//respectively indicated by x axis, Y axis, the original point symmetry three ways void output (Double,double,symmetricstyle);  
    int main () {int x,y;  
    cout<< "The coordinates of the input point:";  
    cin>>x>>y;  
    cout<< "The symmetry point about the x-axis is:";  
    Output (X,Y,AXISX);  
    cout<< "The symmetric point about the y axis is:";  
    Output (X,y,axisy);  
    cout<< "The symmetrical point about the origin of the coordinate is:";  
    Output (X,y,point);  
return 0; void output (double a,double b,symmetricstyle m) {switch (m) {case axisx:cout<<a&  
        lt;< "," <<-b<<endl;  
        Break  
        Case axisy:cout<<-a<< "," <<b<<endl;  
        Break Case Point:cout<<-a<< "," <<-b<<endl;  
    Break  
 }  
}


Run Result:

Experience: Paper tigers, can't afford to toss.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.