Skip to content

Instantly share code, notes, and snippets.

@rogerioagjr
Created March 8, 2016 18:16
Show Gist options
  • Save rogerioagjr/21264aee6af92c219f70 to your computer and use it in GitHub Desktop.
Save rogerioagjr/21264aee6af92c219f70 to your computer and use it in GitHub Desktop.
Consumo
#include <cstdio> // scanf e printf
int main(){
// declaro as variáveis x e y como double
double x, y;
// leio os seus valores
scanf("%lf %lf", &x, &y);
// imprimo o valor de x/y até a terceira casa decimal
// seguido de " km/l" e da quebra de linha
printf("%.3lf km/l\n", x/y);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment