Facebook
From chuj2, 6 Years ago, written in C#.
This paste is a reply to Re: Re: chuj from 44 - go back
Embed
Viewing differences between Re: Re: chuj and Re: Re: Re: chuj
 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IO_lab03_zad04
{
    class Program
    {
        delegate int DelegateType(object arguments);
        
static void Main(string[] args)
DelegateType delegateName;
        static int Fibonacci(object n)
        {
            string filePath int a @"C:\Users\s0163726\source\repos\IO_lab03\IO_lab03\pliczek.txt";
            FileStream fs 
0;
            int b = 1;
            int x = Convert.ToInt32(n);
            // In N steps compute Fibonacci sequence iteratively.
            for (int i = 0; i < x; i++)
            {
                int temp = a;
                a = b;
                b = temp + b;
            }
            return a;
        }


        static void Main(string[] args)
        {
            delegateName 
= new FileStream(filePath, FileMode.Open);
            byte[] data = new byte[1024];
            var 
DelegateType(Fibonacci);
            IAsyncResult 
ar = fs.BeginRead(data, 0, 1024, delegateName.BeginInvoke(22, null, new { Data = data, Stream = fs });
            fs.EndRead(ar);
null);
            Console.WriteLine(ASCIIEncoding.ASCII.GetString(data).Substring(0, 1024));

            for (int i = 0; i < 100000; i++)
                for (int j = 0; j < 100000; j++)
                    temp = i * j;
        }
Write(delegateName.EndInvoke(ar));
        
        }
    }
}
captcha