mercredi 24 décembre 2014

C# giving me repeated output



using System;
using System.Numerics;
namespace Project16
{
class Hello
{
static void Main()
{
BigInteger summand = 0;
BigInteger bigInteger = BigInteger.Pow(2, 1000);
string stringbigInteger = bigInteger.ToString();
BigInteger[] stringbigIntegerArray = new BigInteger[stringbigInteger.Length+1];
for (int i = 0; i <= stringbigInteger.Length; i++)
{
stringbigIntegerArray[i] = BigInteger.Parse(stringbigInteger);
Console.WriteLine(stringbigIntegerArray[i]);
Console.WriteLine("");
}
Console.ReadKey();
}
}
}


The following code gives me a repeated output of 2^1000 (which is a lot of digits). I only want the code to output the number once. What can I do?





Aucun commentaire:

Enregistrer un commentaire