16/11/2022 ; 5:28 PM

This commit is contained in:
2022-11-16 17:28:39 -04:00
commit 6ca133770c
16 changed files with 440 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
#include <stdio.h>
/* Billete de ferrocarril.
El programa calcula el costo de un billete de ferrocarril teniendo en
➥cuenta la distancia entre las dos ciudades y el tiempo de permanencia
➥del pasajero.
DIS y TIE: variables de tipo entero.
BIL: variable de tipo real. */
void main(void)
{
int DIS, TIE;
float BIL;
printf("Ingrese la distancia entre ciudades y el tiempo de estancia: ");
scanf("%d %d", &DIS, &TIE);
if ((DIS * 2 > 500) && (TIE > 10))
BIL = DIS * 2 * 0.19 * 0.8;
else
BIL = DIS * 2 * 0.19;
printf("\n\nCosto del billete: %.2f", BIL);
}