dart - 未处理的异常:FormatException:无效的 radix-10 数字(在字符 1 处)12 2 5.30
问题描述
我正在尝试解决 URI 在线判断问题编号 1010 中的问题。在我的 IDE 中运行代码不会引发错误。但是,它会在 URI 中引发运行时错误。
12 2 5.30
^
#0 int._throwFormatException (dart:core-patch/integers_patch.dart:131)
#1 int._parseRadix (dart:core-patch/integers_patch.dart:142)
#2 int._parse (dart:core-patch/integers_patch.dart:100)
#3 int.parse (dart:core-patch/integers_patch.dart:63)
#4 main (file:///judge/judge-7457cda102c440638d0db570b8eed561.d/Main.dart:7)
#5 _startIsolate. (dart:isolate-patch/isolate_patch.dart:301)
#6 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168)
这是我的代码
import 'dart:io';
void main() {
int a, b;
double c, result;
a = int.parse(stdin.readLineSync()!);
b = int.parse(stdin.readLineSync()!);
c = double.parse(stdin.readLineSync()!);
result = b * c;
a = int.parse(stdin.readLineSync()!);
b = int.parse(stdin.readLineSync()!);
c = double.parse(stdin.readLineSync()!);
result += b * c;
String pagar = result.toStringAsFixed(2);
print('VALOR A PAGAR: R\$ $pagar');
}
提前告诉大家。
解决方案
推荐阅读
- java - How to understand java.lang.management.MemoryMXBean and -Xms?
- google-chrome-extension - 301 Redirected requests not intercepted by Chrome WebRequest API
- owl-carousel - Default owl carousel dots not showing
- javascript - ChartJS中showTooltips为false时如何添加逗号
- node.js - ./node_modules/react-router-dom/node_modules/warning/warning.js 错误:ENOENT:没有这样的文件或目录,打开
- css - 使用自定义域时 Github Pages jekyll 不加载 CSS
- angular - 在组件中处理成功的动作调度
- sql - SSRS 饼图图例
- events - 如何向 Splunk 中的事件添加自定义字段?
- sumo - 如何在 SUMO 模拟中获得角速度