Objective: To be proficient in C ++ programming
Computer task: DesignProgramCalculate the two-point distance
/** Copyright (c) 2011, School of Computer Science, Yantai University * All Rights Reserved. * Author: Qiu xuewei * Completion Date: July 15, October 20, 2012 * version No.: V1.0 ** input Description: two points distance * Problem description: enter coordinates of two points, calculate the distance between two points and output * program output: two points distance * Problem Analysis: omitted *AlgorithmDESIGN: slightly */# include <cmath> // There is no way to calculate the formula without this program # include <iostream> using namespace STD; int main () {double X1, Y1, x2, Y2, D; cout <", enter the coordinate value of the first vertex:"; CIN> x1> Y1; cout <"coordinates of the second point:"; CIN> X2> Y2; D = SQRT (x1-x2) * (x1-x2) + (y1-y2) * (y1-y2); cout <"two points distance:" <D <Endl; return 0 ;}
Experience: Better than the last time, a small victory
Running result: