Winter vacation project 3-application enumeration (design), winter vacation 3-

Source: Internet
Author: User

Winter vacation project 3-application enumeration (design), winter vacation 3-

/** Copyright (c) 2014, School of Computer Science, Yantai University * All rights reserved. * file name: test. cpp * Author: Liu Chang * Completion Date: July 15, January 30, 2015 * version number: v1.0 ** Problem description: Design functions, which can be specified in the following way, the enumeration type definition and main function (test function) are given below the symmetry points of the output plane point. write out the implementation of the output function .. * Input Description: coordinates of the input vertex * program output: outputs the coordinates of the symmetric vertex of the vertex.

The Code is as follows:

# Include <iostream> using namespace std; enum using ricstyle {axisx, axisy, point}; void output (double, double, character ricstyle); int main () {int x, y; cout <"coordinates of the Input Point:"; cin> x> y; cout <"Symmetry points on the x axis are:"; output (x, y, axisx ); cout <"the symmetry points on the y axis are:"; output (x, y, axisy); cout <"the symmetry points on the coordinate origin are:"; output (x, y, point); return 0;} void output (double x, double y, character ricstyle s) {switch (s) {case axisx: cout <'(' <x <',' <-y <')'; break; case axisy: cout <'(' <-x <',' <y <')'; break; case point: cout <'(' <-x <',' <-y <')'; break;} cout <endl; return ;}

Running result:


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.