Advertisement
Guest User

Untitled

a guest
Nov 20th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.60 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace InstrukcjeWarunkowe05
  8. {
  9.     class Program
  10.     {
  11.         static double Funkcja1(int a, int b, int c)
  12.         {
  13.             if (a>=0 && b>=0 && c>=0)
  14.             {
  15.                 return (a+2.0*b-5.0*c) / (a * c);
  16.             }
  17.             else
  18.             {
  19.                 return -1;
  20.             }
  21.         }
  22.  
  23.         static void Main(string[] args)
  24.         {
  25.             Console.WriteLine(Funkcja1(1,2,5));
  26.             Console.ReadKey();
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement