fork download
  1. using System.Console;
  2. public class Test
  3. {
  4. public static Main() : void
  5. {
  6. def f = ReadLine();
  7. mutable x = 0;
  8. mutable y = 1;
  9. for(mutable i = 99; i >= 0; i--){
  10. if(f[i] == '1'){
  11. x = x+y;
  12. }
  13. else{
  14. x = x;
  15. }
  16. y *= 2;
  17. }
  18. WriteLine(x);
  19. }
  20. }
Runtime error #stdin #stdout #stderr 0.03s 16168KB
stdin
0000110010101111101010110001000001010100111011011010000100100101110110110010110100000001111100101000
stdout
Standard output is empty
stderr
Unhandled Exception: System.OverflowException: Number overflow.
  at Test.Main () [0x00000]