fork download
  1. using System;
  2.  
  3. class Test
  4. {
  5. static void test(string s)
  6. {
  7. int id;
  8. if (!int.TryParse(s, out id)) {
  9. // can't parse
  10. id = 0;
  11. }
  12. Console.WriteLine("{0} = {1}", s, id);
  13. }
  14. static void Main()
  15. {
  16. test("100500");
  17. test("blabla");
  18. }
  19. }
Success #stdin #stdout 0.03s 37032KB
stdin
Standard input is empty
stdout
100500 = 100500
blabla = 0