Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication33
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int num;
  14. int dig;
  15. int wow;
  16. int wowl;
  17. int din = 0;
  18. int aor;
  19. for (aor = 1; aor <= 30; aor++)
  20. {
  21. Console.WriteLine("Please enter a number.");
  22. num = int.Parse(Console.ReadLine());
  23. Console.WriteLine("Please enter a digit.");
  24. dig = int.Parse(Console.ReadLine());
  25. wow = num;
  26. while (wow > 0)
  27. {
  28. wow /= 10;
  29. wowl = wow % 10;
  30. if (wowl == dig)
  31. {
  32. din++;
  33. }
  34. if (din < 0)
  35. {
  36. Console.WriteLine("The digit appears in the number.");
  37. }
  38. }
  39. }
  40. }
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement