Advertisement
Guest User

Untitled

a guest
Sep 15th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.22 KB | None | 0 0
  1. using System;
  2.  
  3.  
  4. namespace ConsoleApp1
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.  
  11.             Console.WriteLine("Podaj pierwsza liczbe:      ");
  12.             int liczbapierwsza = int.Parse(Console.ReadLine());
  13.  
  14.             Console.WriteLine("Podaj druga liczbe:      ");
  15.             int liczbadruga = int.Parse(Console.ReadLine());
  16.  
  17.             Console.WriteLine("Podaj trzecia liczbe:      ");
  18.             int liczbatrzecia = int.Parse(Console.ReadLine());
  19.  
  20.  
  21.             if (liczbapierwsza > 0 && liczbadruga >0 && liczbatrzecia > 0)
  22.  
  23.             {
  24.                 Console.WriteLine("TAK");
  25.             }
  26.             else
  27.             {
  28.                 Console.WriteLine("NIE");
  29.             }
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.         }
  37.     }
  38. }
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51. /**
  52.  I. Napisz, program który pobiera od użytkownika trzy liczby typu int i sprawdza czy wszystkie są
  53. większe od 0. Schemat programu:
  54.  
  55. Podaj pierwszą liczbę: 1
  56. Podaj drugą liczbę: 4
  57. Podaj trzecią liczbę: 77
  58. TAK
  59.  
  60. Wywołanie alternatywne:
  61.  
  62. Podaj pierwszą liczbę: -5
  63. Podaj drugą liczbę: 2
  64. Podaj trzecią liczbę: 11
  65. NIE
  66.  
  67. Wskazówki: Console.Write, int.Parse, Console.ReadLine, if, Console.WriteLine
  68. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement