jueves, 1 de noviembre de 2012

ejercicio 02 (PARA HALLAR LA DISTANCIA)


#include <iostream>
using namespace std;
int main ()
{
//halar la distancia
// d=distancia; v=velocidad inicial; vf=velocidad final; t=tiempo;
float d;
float v;
float vf;
float t;
cout << "loa cata-o rusell" << endl;
cout << "ingrese le velocidad inicial" << endl;
cin>> v;
cout << "ingrese la velocidad final" << endl;
cin>> vf;
cout << "ingrese el tiempo" << endl;
cin>> t;
cout << "la distacia es" << endl;
d=(vf+v)*t/2;
cout << "d"<<"="<<"("<<vf<<"+"<<v<<")"<<"="<<"d" << endl;
system ("pause");
return 0;
}

No hay comentarios:

Publicar un comentario