累乗を行うサンプル

  1. using System;
  2. using System.Text;
  3. namespace ConsoleApplication1
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             // 2の2乗
  10.             Console.WriteLine("Math.Pow(2, 2) = " + Math.Pow(2, 2));
  11.             // 2の3乗
  12.             Console.WriteLine("Math.Pow(2, 3) = " + Math.Pow(2, 3));
  13.             
  14.             Console.ReadLine();
  15.         }
  16.     }
  17. }

image

戻る