fork download
  1. # include <iostream>
  2. # include <cmath> // biblioteca de variables matematicas para operar //
  3. using namespace std ;
  4.  
  5. int main () {
  6. // Definimos cuatro variables 1,2,3 y suma del tipo double //
  7. double M1;
  8. double M2;
  9. double M3;
  10. double suma;
  11. // Se imprime un mensaje al usuario //
  12. cout << " Ingrese un numero y espere " << endl ;
  13. cin >> M1;
  14. // Se lee un numero ingresado a traves del teclado //
  15.  
  16. // Se imprime un mensaje al usuario //
  17. cout << " Ingrese otro numero y espere " << endl ;
  18. cin >> M2;
  19. // Se lee un numero ingresado a traves del teclado //
  20.  
  21. // Se imprime un mensaje al usuario //
  22. cout << " Ingrese otro numero y espere " << endl ;
  23. cin >> M3;
  24. // Se lee un numero ingresado a traves del teclado //
  25.  
  26. // Se imprime un mensaje y la suma de los cuatro numeros //
  27. suma = M1 + M2 + M3;
  28. cout << "La suma de los numeros ingresados es:" << suma << endl ;
  29.  
  30. return 0;
  31.  
  32. }
Success #stdin #stdout 0s 5308KB
stdin
1.1 2.2 3.3
stdout
 Ingrese un numero y espere 
 Ingrese otro numero y espere 
 Ingrese otro numero y espere 
La suma de los numeros ingresados es:6.6