“Konversi kode python ke java” Kode Jawaban

Konversi kode python ke java

def BitmapHoles(strArr):
    bitmap = {}
    for i in range(len(strArr)):
        for j in range(len(strArr[i])):
            bitmap[(i,j)] = int(strArr[i][j])
    
    hole_count = 0
    hole = set()
    checked = set()
    flag = True
    
    for i in range(len(strArr)):
        for j in range(len(strArr[i])):
            stack = [(i,j)]
            while stack:
                coords = stack.pop()
                if coords not in checked:
                    checked.add(coords)
                    if bitmap[coords] == 0 and coords not in hole:
                        hole.add(coords)
                        if flag == True:
                            hole_count += 1
                            flag = False
                        if coords[0] - 1 >= 0 and (coords[0]-1,coords[1]) not in checked:
                            stack.append((coords[0]-1,coords[1]))
                        if coords[0] + 1 < len(strArr) and (coords[0]+1,coords[1]) not in checked:
                            stack.append((coords[0]+1,coords[1]))
                        if coords[1] - 1 >= 0 and (coords[0],coords[1]-1) not in checked:
                            stack.append((coords[0],coords[1]-1))
                        if coords[1] + 1 < len(strArr[coords[0]]) and (coords[0],coords[1]+1) not in checked:
                            stack.append((coords[0],coords[1]+1))
            flag = True
            
    return hole_count
Long Lion

Konversi kode python ke java

def tipo_melenudos(lista):
    lista_nueva=[]
    for i in range(len(lista)):
        if lista[i] not in lista_nueva:
            lista_nueva.append(lista[i])
    return lista_nueva
Better Bison

Konversi kode python ke java

def tipo_melenudos(lista):
    lista_nueva=[]
    for i in range(len(lista)):
        if lista[i] not in lista_nueva:
            lista_nueva.append(lista[i])
    return lista_nueva
Better Bison

Konversi kode python ke java

name=input("enter name:")
majorr=input("enter major:")
minorr=input("enter minor:")
f="\n"+name+".lst:"+majorr+":"+minorr+":arbic"
p=f.replace(' ','')
file1 = open(r"C:\gate\GATE_Developer_8.1\plugins\Lang_Arabic\resources\gazetteer\lists.def","a+")
file1.write(p)
file1 = open(rf"C:\gate\GATE_Developer_8.1\plugins\Lang_Arabic\resources\gazetteer\{name}.lst","a+")
Add_item=input("enter item:")
file1.write(Add_item)
Lonely Lemur

Python to Java Converter

print("heelo")
Prickly Plover

Jawaban yang mirip dengan “Konversi kode python ke java”

Pertanyaan yang mirip dengan “Konversi kode python ke java”

Lebih banyak jawaban terkait untuk “Konversi kode python ke java” di Python

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya