SHOW:
|
|
- or go back to the newest paste.
| 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) |
| 13 | + | if (a<=0 || b<=0 || c<=0) |
| 14 | {
| |
| 15 | - | return (a+2.0*b-5.0*c) / (a * c); |
| 15 | + | |
| 16 | } | |
| 17 | - | else |
| 17 | + | return (a+2.0*b-5.0*c) / (a * c); |
| 18 | } | |
| 19 | ||
| 20 | static void Main(string[] args) | |
| 21 | {
| |
| 22 | Console.WriteLine(Funkcja1(1,2,5)); | |
| 23 | Console.ReadKey(); | |
| 24 | } | |
| 25 | } | |
| 26 | } |