Advertisement
Cassimus

dlug

Feb 1st, 2025
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.49 KB | None | 0 0
  1. public class Dlug
  2. {
  3.     public static void Main(string[] args)
  4.     {
  5.         decimal dlug = 80m;
  6.         decimal zarobkiJanek = 50m;
  7.         decimal zarobkiKarol = 40m;
  8.  
  9.         decimal uzbierano = 0m;
  10.         int dni = 0;
  11.  
  12.         do
  13.         {
  14.             uzbierano = uzbierano + zarobkiJanek * 0.2m +
  15.                         zarobkiKarol * 0.2m;
  16.             dni++;
  17.         } while (uzbierano < dlug);
  18.  
  19.         System.Console.WriteLine("Uzbierano po " + dni + " dniach");
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement