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;
- namespace ConsoleApplication4
- {
- class Program
- {
- static int QuanOfNum(int a, ref int q)
- {
- if (a > 0)
- {
- a /= 10;
- q++;
- return QuanOfNum(a, ref q);
- }
- else
- return q;
- }
- static void Main(string[] args)
- {
- int q = 0;
- Console.WriteLine("Введите a: ");
- int a = int.Parse(Console.ReadLine());
- Console.WriteLine("Количество чисел {0} — {1}", a, QuanOfNum(a, ref q));
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement