Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Net;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Navigation;
- using Microsoft.Phone.Controls;
- using Microsoft.Phone.Shell;
- using System.Diagnostics;
- using System.Threading;
- namespace testy_wp
- {
- public partial class Test2 : PhoneApplicationPage
- {
- public Test2()
- {
- int max = 1000;
- String tekst = "";
- long[] series = new long[max];
- series[0] = 0;
- series[1] = 1;
- Stopwatch stopwatch = new Stopwatch();
- stopwatch.Start();
- for (int i = 2; i < max; i++)
- {
- series[i] = series[i - 1] + series[i - 2];
- }
- tekst = "Ciąg Fibannaciego dla " + max + " wyrazów" + "\n" + "\n";
- for (int i = 0; i < max; i++)
- {
- tekst += series[i] + "\n";
- }
- stopwatch.Stop();
- WynikTest2.Text = ("Wykonanie zajęło " + stopwatch.Elapsed.TotalMilliseconds.ToString() + " sek." + "\n" + "\n" + tekst);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement