fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. // your code goes here
  8. int n = 18364822;
  9. string s = n.ToString();
  10.  
  11. Console.WriteLine(s);
  12. int count =0;
  13. foreach(char c in s)
  14. {
  15. if(c =='8')
  16. count++;
  17. }
  18.  
  19. Console.WriteLine(count);
  20. }
  21. }
  22.  
Success #stdin #stdout 0.05s 24772KB
stdin
Standard input is empty
stdout
18364822
2