Advertisement
LightProgrammer000

Calculo_Segundos

Jun 14th, 2023
1,086
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 0.53 KB | None | 0 0
  1. // Bibliotecas
  2. import 'dart:io';
  3.  
  4. // Funcao principal
  5. main() {
  6.   // Funcao
  7.   print(entDados());
  8. }
  9.  
  10. // Funcao: Entrada de dados
  11. int entDados() {
  12.   // Variaveis
  13.   int d, h, m;
  14.  
  15.   stdout.write("# Dias: ");
  16.   d = int.parse(stdin.readLineSync()!);
  17.  
  18.   stdout.write("# Horas: ");
  19.   h = int.parse(stdin.readLineSync()!);
  20.  
  21.   stdout.write("# Minutos: ");
  22.   m = int.parse(stdin.readLineSync()!);
  23.  
  24.   return calculoSeg(d, h, m);
  25. }
  26.  
  27. // Calculo
  28. int calculoSeg(int d, int h, int m) {
  29.   return 60 * (d * 24 * 60 + h * 60 + m);
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement