跟小D每日学口语
摘要: 这个程序时实现N的阶乘,但始终不明白ff();函数中else…两句的工作原理。请具体解释下面//两句。long ff(int n){long f;if(n<0) printf("n<0,input error");else if(n==0||n==1) f=1; //为什么f=1,就不再继续递归调用?else f=ff(n-1)*n;//这一步到底是怎么工作的?return... 阅读全文
posted @ 2010-08-04 21:13 简简单单幸福 阅读(2346) 评论(1) 推荐(0) 编辑
摘要: static void Main(string[] args) { string str2 = ""; Method("1234", str2); Console.WriteLine(counter); Console.ReadKey(); } static void Method(string str,string str2) { if (str == null) return; if (str... 阅读全文
posted @ 2010-08-04 17:41 简简单单幸福 阅读(3633) 评论(0) 推荐(0) 编辑
摘要: classClass1{[STAThread]staticvoidMain(string[]args){//初始化链表LineNotestartnote=newLineNote("1");LineNotenote=startnote;for(inti=2;i<=5;i++){note.Next=newLineNote(i.ToString());note=note.Next;}note=st... 阅读全文
posted @ 2010-08-04 15:33 简简单单幸福 阅读(493) 评论(0) 推荐(0) 编辑