Advertisement
Spocoman

02. Passed

Jan 10th, 2022
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.59 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Passed
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double score = double.Parse(Console.ReadLine());
  10.  
  11.             if (score >= 3)
  12.             {
  13.                 Console.WriteLine("Passed!");
  14.             }
  15.         }
  16.     }
  17. }
  18.  
  19.  
  20. With ternary operatop:
  21.  
  22. using System;
  23.  
  24. namespace Passed
  25. {
  26.     class Program
  27.     {
  28.         static void Main(string[] args)
  29.         {
  30.             double score = double.Parse(Console.ReadLine());
  31.             Console.WriteLine(score >= 3 ? "Passed!" : "");
  32.         }
  33.     }
  34. }
  35.  
  36.  
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement