Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- int a, n, total;
- a = int.Parse(Console.ReadLine());
- n = int.Parse(Console.ReadLine());
- total = a;
- if (n == 0)
- {
- total = 1;
- }
- else
- {
- for (n = n - 1; n > 0; n--)
- {
- total = total * a;
- }
- }
- Console.WriteLine(total);
- Console.ReadLine();
- }
- }
- }
Add Comment
Please, Sign In to add comment