迭代

没有调用自身的解法叫做迭代。例如一些循环,区别于递归。
例子引自csdn博客,
https://blog.csdn.net/weixin_30300523/article/details/97982320?utm_medium=distribute.pc_relevant_download.none-task-blog-baidujs-2.nonecase&depth_1-utm_source=distribute.pc_relevant_download.none-task-blog-baidujs-2.nonecase

//迭代的方法
public static void ff(int index){
int a = 1;
int b = 1;
int c = 0;
int i = 0;
while(i < index ){
c = a + b;
a = b;
b = c;
System.out.println©;
i ++ ;
}
}

你可能感兴趣的:(编程,算法)