void Path1(bool a, bool b, bool c, bool d){ if(a){ if(b){ if(c){ if(d){ Console.WriteLine("a->b->c->d"); }else{ Console.WriteLine("a->b->c"); } }else{ Console.WriteLine("a->b"); } }else{ Console.WriteLine("a"); } }else{ Console.WriteLine(""); } } void Path2(bool a, bool b, bool c, bool d){ if(!a){ Console.WriteLine(""); return; } if(!b){ Console.WriteLine("a"); return; } if(!c){ Console.WriteLine("a->b"); return; } if(!d){ Console.WriteLine("a->b->c"); return; } Console.WriteLine("a->b->c->d"); } string PathValue(bool a, bool b, bool c, bool d){ if(!a){ return ""; } if(!b){ return "a"; } if(!c){ return "a->b"; } if(!d){ return "a->b->c"; } return "a->b->c->d"; } void Path3(bool a, bool b, bool c, bool d){ Console.WriteLine(PathValue(a,b,c,d)); } void Path3(bool a, bool b, bool c, bool d){ if(a){ if(b){ if(c){ if(d){ Console.WriteLine("a->b->c"); }else{ Console.WriteLine("a->b->c->d"); } }else{ Console.WriteLine("a->b"); } }else{ Console.WriteLine("a"); } }else{ Console.WriteLine(""); } } Path(true,true,false,false);