* Copyright (c) 2014, School of Computer Science, Yantai University. * Allrightsreserved. * file name: test. cpp * Author: Lu yunjie * Completion Date: July 15, March 19, 2015 * version: v1.0 *** Problem description: triangle type 2 * program input: triangular three-sided length * program output: omitted * # includeiostream # includeCmath # inc
* Copyright (c) 2014, School of Computer Science, Yantai University. * All rights reserved. * file name: test. cpp * Author: Lu yunjie * Completion Date: July 15, March 19, 2015 * version: v1.0 *** Problem description: triangle type 2 * program input: triangular three-sided length * program output: omitted */# includeiostream # includeCmath # inc
Zookeeper
* Copyright (c) 2014, School of Computer Science, Yantai University.
* All rights reserved.
* File name: test. cpp
* Author: Lu yunjie
* Completion date: January 1, March 19, 2015
* Version: v1.0
*
*
* Problem description: triangle type 2
* Program input: the three sides of the triangle are long.
* Program output: omitted
*/
# Include
# Include
# Include
Using namespace std; class Triangle {public: void setA (double x) {a = x;} void setB (double y) {B = y;} void setC (double z) {c = z;} bool isTriangle () {if (a + B> c & a + c> B & B + c> a) return (1 ); else return (0);} double getA () {return a;} double getB () {return B;} double getC () {return c;} double perimeter (void) {return a + B + c;} double area (void) {double p = (a + B + c)/2; cout <
> X> y> z; tri1.setA (x); tri1.setB (y); tri1.setC (z); // if (tri1.isTriangle ()) {cout <"three sides:" <