1
import 'dart:io';
void main() {
double base = 1, bnry = 0, remainder = 0, ans = 0, inp;
print("Please input binary number : ");
inp = stdin.readLineSync();
bnry = inp;
while(inp < 1){
remainder = inp % 10;
ans = ans + remainder * base;
base = base * 2;
inp = inp/10;
}
print("$inp");
}
這個小錯誤,這是我的代碼,這裏是錯誤消息有使用飛鏢
unhandled exception: Class 'String' has no instance method '<'. NoSuchMethodError: method not found: '<'