Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Z_4
- {
- class Program
- {
- static void Main(string[] args)
- {
- int q = 1;
- int q1 = 1;
- while (q == q1)
- {
- int count = 0;
- Console.WriteLine("Введите число: ");
- string s = Console.ReadLine();
- s = s.Replace(".", string.Empty);
- int a = int.Parse(s);
- while (a > 0)
- {
- int b = a % 10;
- a = a / 10;
- if (b % 3 == 0)
- {
- count += 1;
- }
- }
- Console.WriteLine("count= " + count);
- Console.WriteLine("Если хотите продолжить то введите 1");
- q = int.Parse(Console.ReadLine());
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement