Generation

generate functionFri, 14 Apr 2023

Se requiere determinar el tiempo que tarda una persona en llegar de una ciudad a otra en bicicleta, considerando que lleva una velocidad constante. Elabore un programa en C++ que permita resolver el problema

#include <iostream> int main() { // your code goes here int d; std::cin >> d; int v; std::cin >> v; int t; std::cin >> t; int time = d / v + (d % v > 0 ? 1 : 0); if(time > t) std::cout << "Tiempo excedido" << std::endl; else std::cout << "Tiempo no excedido" << std::endl; return 0; }

Questions about programming?Chat with your personal AI assistant