0
How do I read more than one value in a single line? For the exercise I’m doing says the following:
the input file contains two rows of data. In each row there will be 3 values, respectively two integers and a value with 2 decimal places. For example:
12 1 5.30
16 2 5.10
I tried to do the exercise using the method:
stdin.readLineSync()
, but he always jumps to the next line.
int codigoPeca1 = int.tryParse(stdin.readLineSync());
int numeroPeca1 = int.tryParse(stdin.readLineSync());
double valorUnitarioPeca1 = double.tryParse(stdin.readLineSync());
int codigoPeca2 = int.tryParse(stdin.readLineSync());
int numeroPeca2 = int.tryParse(stdin.readLineSync());
double valorUnitarioPeca2 = double.tryParse(stdin.readLineSync());
I’ve already searched and found nothing related in Dart.
Thank you so much for helping Matheus! I studied the code and managed to solve my problem.
– Matheus Cavalcante