repl.it
@RicardoYalico/

5.1 Funciones

C++

No description

fork
loading
Files
  • main.cpp
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <iostream>
using namespace std;

char FuncionEquilatero(int a, int b, int c) {
	char equilatero, escaleno, isosceles;
	equilatero = (a == b && a == c && b&&c)*'V' + (a != b && a != c && b != c)*'F' + (a == b && a != c && b != c)*'F' + (a == c && a != b && c != b)*'F' + (b == c && b != a && c != a)*'F';
	escaleno = (a != b && a != c && b != c)*'V' + (a == b && a == c && b == c)*'F' + (a == b && a != c && b != c)*'F' + (a == c && b != c && a != c)*'F' + (b == c && b != a && c != a)*'F';
	isosceles = (a != b && a != c && b != c)*'F' + (a == b && a == c && b == c)*'F' + (a == b && a != c && b != c)*'V' + (a == c && b != c && a != c)*'V' + (b == c && b != a && c != a)*'V';
	cout << "Equilatero :" << equilatero<<endl;
	cout << "Isosceles :" << isosceles<<endl;
		cout << "Escaleno :" << escaleno<<endl;
		return 0;
}



int main() {
	int L1, L2, L3;
	char Resultado;
	cout << "Ingrese lado 1 :"; cin >> L1;
	cout << "Ingrese lado 2 :"; cin >> L2;
	cout << "Ingrese lado 3 :"; cin >> L3;


	cout << FuncionEquilatero(L1, L2, L3);

	
	return 0;
}