CORREO:calderonnestor421@gmail.com
https://repl.it/@NestorOrlando/GivingExaltedScript
#include <iostream>
using namespace std;
#include <cstdlib>
#include <stdio.h>
float x,y,z,u,a[10],b[10];
float c[10],d[10],e[10],det;
void tresincognitas(void)
{
printf("\n\t SISTEMA DE ECUACIONES LINEALES CON TRES INCOGNITAS\n");
printf("\t --------------------------------------------------\n");
//Polinomio 1
cout<<"\nIngresar el primer Polinomio:\n\n";
//2 3 1 1
cin>>a[1];cin>>b[1];cin>>c[1];cin>>d[1];
//Polinomio 2
cout<<"\n";
cout<<"\nIngresar el Segundo Polinomio:\n\n";
//3 2 4 3
cin>>a[2];cin>>b[2];cin>>c[2];cin>>d[2];
cout<<"\n";
cout<<"\nIngresar el Tercer Polinomio:\n\n";
//5 -1 -1 4
cin>>a[3]; cin>>b[3];cin>>c[3];cin>>d[3];
cout<<"\t _____________________________\n";
cout<<"\t| |=- \n";
cout<<"\t| "<<a[1]<<"x"<<"\t"<<b[1]<<"y\t"<<c[1]<<"z"<<"\t"<<d[1]<<" | \n";
cout<<"\t| "<<a[2]<<"x"<<"\t"<<b[2]<<"y\t"<<c[2]<<"z"<<"\t"<<d[2]<<" | \n";
cout<<"\t| "<<a[3]<<"x"<<"\t"<<b[3]<<"y\t"<<c[3]<<"z"<<"\t"<<d[3]<<" | \n";
cout<<"\t|_____________________________|=-\n";
det=(a[1]*b[2]*c[3])+(b[1]*c[2]*a[3])+(c[1]*a[2]*b[3])-(a[3]*b[2]*c[1])-(b[3]*c[2]*a[1])-(c[3]*a[2]*b[1]);
if(det==0)
printf("\n\tLas ecuaciones son incompatibles");
else
{/*inicio de la funcion sino*/
x=((d[1]*b[2]*c[3])+(b[1]*c[2]*d[3])+(c[1]*d[2]*b[3])-(d[3]*b[2]*c[1])-(b[3]*c[2]*d[1])-(c[3]*d[2]*b[1]))/det;
y=((a[1]*d[2]*c[3])+(d[1]*c[2]*a[3])+(c[1]*a[2]*d[3])-(a[3]*d[2]*c[1])-(d[3]*c[2]*a[1])-(c[3]*a[2]*d[1]))/det;
z=((a[1]*b[2]*d[3])+(b[1]*d[2]*a[3])+(d[1]*a[2]*b[3])-(a[3]*b[2]*d[1])-(b[3]*d[2]*a[1])-(d[3]*a[2]*b[1]))/det;
printf("\n\t\t\tLa Solucion es...");
printf("\n\t\t\t x es:%g",x);
printf("\n\t\t\t y es:%g",y);
printf("\n\t\t\t z es:%g",z);
printf("\n\n\nDocente:Nestor Calderon Hernandez\t\t\t");
printf("\n\n\n");
}/*fin de la funcion sino*/
//getch();
}
int main()
{
tresincognitas();
}
Ejercicios
No hay comentarios:
Publicar un comentario