Advertisement
LuftAffe

15_17

Apr 2nd, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.93 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Lab15{
  4.     class Program{
  5.         static void Main(string[] args){
  6.             double x = double.Parse(Console.ReadLine());
  7.             double y = double.Parse(Console.ReadLine());
  8.             Console.WriteLine("{0}", f(x, y) * Math.Log(f(x, 1)));
  9.             double temp1 = 0;
  10.             f1(x, y, ref temp1);
  11.             double temp2 = 0;
  12.             f1(x, 1.0, ref temp2);
  13.             Console.WriteLine("{0}", temp1 * Math.Log(temp2));
  14.             f2(x, y, out temp1);
  15.             f2(x, 1.0, out temp2);
  16.             Console.WriteLine("{0}", temp1 * Math.Log(temp2));
  17.             Console.ReadKey();
  18.         }
  19.         static double f(double x, double y){
  20.             return x * x + y;
  21.         }
  22.         static void f1(double x, double y, ref double z1){
  23.             z1 = x * x + y;
  24.         }
  25.         static void f2(double x, double y, out double z1){
  26.             z1 = x * x + y;
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement