编程语言
首页 > 编程语言> > java 折纸问题

java 折纸问题

作者:互联网

public class C {
public static void printAllFoids(int N){
printProcess(1,N,true);
}
public static void printProcess(int i,int N,boolean down){
//i是节点的层数,N是一共的层数,down==true 凹 down==false 凸
if(i>N){
return;
}else {printProcess(i+1,N,true);}
System.out.print(down ?"凹":"凸");
printProcess(i+1,N,false);
}
public static void main (String[]args){
int N=3;
printAllFoids(N);
}}

标签:printProcess,down,java,int,void,问题,折纸,static,public
来源: https://www.cnblogs.com/hhc16619804375/p/14698236.html