using System; public class Fib { movable Compute( int n, Channel( int ) c ) { if ( n < 30 ) c.Send( cfib( n ) ); else { Fib f = new Fib(); Compute( n - 1, f.c1 ); c.Send( cfib( n - 2 ) + f.Get() ); } } int Get() & Channel c1( int x ) { return ( x ); } private int cfib( int n ) { if ( n <= 1 ) return 1; else return cfib( n - 1 ) + cfib( n - 2 ); } } class ComputeFib { public static void Main( String[] args ) { int n = System.Convert.ToInt32( args [ 0 ] ); ComputeFib cf = new ComputeFib(); Fib fib = new Fib(); fib.Compute( n, cf.c ); Console.WriteLine( "For n = " + n + " value is " + cf.Get() ); } int Get() & Channel c( int x ) { return x; } }