dxnge

Untitled

Oct 9th, 2022 (edited)
773
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp6
  4. {
  5.     internal class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double l = 0.1, d = 10;
  10.             int cnt = 0;
  11.  
  12.             for(int i = 0; i <= 10; i++)
  13.             {
  14.                 d *= 0.1;
  15.             }
  16.  
  17.             while (l > d)
  18.             {
  19.                 l /= 2; cnt++;
  20.             }
  21.  
  22.             Console.WriteLine($"{cnt}");
  23.         }
  24.     }
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment