Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Collatz Conjecture Using Pi
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { float n = 5; double pi = Math.PI; Console.WriteLine(pi); for(int i = 1; i < pi;) { //Even if(pi % 2 == 0) { pi = pi/2; Console.WriteLine(pi); } //Odd if(pi % 2 != 0 && pi != 1) { pi = 3*pi+1; Console.WriteLine(pi); } } } } }
run
|
edit
|
history
|
help
0
Math 10.8 added quad seq
Lambda Expressions Are Cool
svitch
first case
Метод catch b try в словарях
12
Prime Fibonacci
saira_pr1.c
Pascal Tringle
Interface