Advertisement
Guest User

cos

a guest
Mar 2nd, 2015
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. static void Main(string[] args)
  2. {
  3. ulong wykladnik, liczba, wynik;
  4.  
  5.  
  6.  
  7. Console.WriteLine("Podaj liczbę");
  8. liczba = Convert.ToUInt64(Console.ReadLine());
  9.  
  10. wynik = liczba;
  11.  
  12. Console.WriteLine("Podaj wykładnik");
  13. wykladnik = Convert.ToUInt64(Console.ReadLine());
  14. Console.WriteLine();
  15.  
  16. if (wykladnik == 0)
  17. {
  18. Console.WriteLine(wynik = 1);
  19. }
  20.  
  21. else if (wykladnik > 1)
  22. {
  23. for (uint i = 1; i < wykladnik; i++)
  24. {
  25. wynik = wynik * liczba;
  26. Console.WriteLine(liczba + " do " + wykladnik + " = " + wynik);
  27. }
  28. }
  29.  
  30. Console.ReadKey();
  31.  
  32. }
  33.  
  34.  
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement