triangle of 0 and 1
class Main {
public static void main(String[] args) {
int n = 5;
int cv = 1;
for(int i = 1; i <= n; i++){
for(int j = 1; j <= i; j++){
System.out.print(cv);
if(cv == 1){
cv = 0;
}
else{
cv = 1;
}
}
System.out.println();
}
}
}INFO