Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int NineCount = 0;
- int HowManyBeeps = 0;
- while (NineCount < 300)
- {
- for (int i = 0; i < 2000; i++)
- {
- if (i.ToString().Contains("9"))
- {
- NineCount++;
- HowManyBeeps = i - NineCount;
- }
- else if (i % 9 == 0)
- {
- NineCount++;
- HowManyBeeps = i - NineCount;
- }
- else if (!i.ToString().Contains("9") && i % 9 == 0)
- {
- NineCount++;
- HowManyBeeps = i - NineCount;
- }
- }
- }
- Console.WriteLine(HowManyBeeps);
- Console.ReadLine();
- //You need to get up to 1552 for 300 beeps for all divisible by 9's for 300
- // 1457 for all containing 9
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement