Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Untitled

a guest Mar 28th, 2020 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace _6
  4. {
  5.     class Program
  6.     {
  7.         static void Main()
  8.         {
  9.             var foodInGrams = double.Parse(Console.ReadLine()) * 1000;
  10.  
  11.             var eatenFood = Console.ReadLine();
  12.  
  13.             while(eatenFood != "Adopted")
  14.             {
  15.                 foodInGrams -= int.Parse(eatenFood);
  16.                 eatenFood = Console.ReadLine();
  17.  
  18.             }
  19.  
  20.             if (foodInGrams >= 0)
  21.             {
  22.                 Console.WriteLine("Food is enough! Leftovers: {0} grams.", foodInGrams);
  23.             }
  24.             else
  25.             {
  26.                 Console.WriteLine("Food is not enough. You need {0} grams more.", Math.Abs(foodInGrams));
  27.             }
  28.  
  29.         }
  30.     }
  31. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top