HITXDDDDDDDDD

Kolorwanie:
Status:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
import math
text = input("Podaj text:")
plot = 3
plotkopia = plot
#print(text)
tab = []
def split(word): # podział na litery
    return [char for char in word]
#print(len(text))
text = split(text)
i = 0
ile = math.floor(len(text)/(plot+1))
reszta = len(text)%(plot+1)
#print(reszta)
#print(ile)
j = 0
k = 0
if (reszta == 0):
    for litera in text:
        if (i<ile):
            if(i * (plot + 1)<10):
                tab.append("0"+str(i * (plot + 1)) + "|" + litera)
                #print("0"+str(i * (plot + 1)) + "|" + litera)
            else:
                tab.append(str(i*(plot+1))+"|"+litera)
            i = i+1
        elif (i==ile and j<ile*2):
            if(math.ceil((j * (plot + 1) / 2)) + 1<10):
                tab.append("0"+str(math.ceil((j * (plot + 1) / 2)) + 1) + "|" + litera)
                #print(("0"+str(math.ceil((j * (plot + 1) / 2)) + 1) + "|" + litera))
            else:
                tab.append(str(math.ceil((j*(plot+1)/2))+1)+"|"+litera)
            j = j+1
        elif (j==ile*2 and k<ile):
            if((k*(plot+1))+2<10):
                tab.append("0"+str((k*(plot+1))+2)+"|"+litera)
                #print("0"+str((k*(plot+1))+2)+"|"+litera)
            else:
                tab.append(str((k*(plot+1))+2)+"|"+litera)
            k = k+1
if (reszta == 1):
    for litera in text:
        if (i<ile+1):
            if(i * (plot + 1)<10):
                tab.append("0"+str(i * (plot + 1)) + "|" + litera)
                #print("0"+str(i * (plot + 1)) + "|" + litera)
            else:
                tab.append(str(i*(plot+1))+"|"+litera)
            i = i+1
        elif (i==ile+1 and j<ile*2):
            if(math.ceil((j * (plot + 1) / 2)) + 1<10):
                tab.append("0"+str(math.ceil((j * (plot + 1) / 2)) + 1) + "|" + litera)
                #print(("0"+str(math.ceil((j * (plot + 1) / 2)) + 1) + "|" + litera))
            else:
                tab.append(str(math.ceil((j*(plot+1)/2))+1)+"|"+litera)
            j = j+1
        elif (j==ile*2 and k<ile):
            if((k*(plot+1))+2<10):
                tab.append("0"+str((k*(plot+1))+2)+"|"+litera)
                #print("0"+str((k*(plot+1))+2)+"|"+litera)
            else:
                tab.append(str((k*(plot+1))+2)+"|"+litera)
            k = k+1
if (reszta == 2):
    for litera in text:
        if (i<ile+1):
            if(i * (plot + 1)<10):
                tab.append("0"+str(i * (plot + 1)) + "|" + litera)
                #print("0"+str(i * (plot + 1)) + "|" + litera)
            else:
                tab.append(str(i*(plot+1))+"|"+litera)
            i = i+1
        elif (i==ile+1 and j<ile*2+1):
            if(math.ceil((j * (plot + 1) / 2)) + 1<10):
                tab.append("0"+str(math.ceil((j * (plot + 1) / 2)) + 1) + "|" + litera)
                print(("0"+str(math.ceil((j * (plot + 1) / 2)) + 1) + "|" + litera))
            else:
                tab.append(str(math.ceil((j*(plot+1)/2))+1)+"|"+litera)
            j = j+1
        elif (j==ile*2+1 and k<ile):
            if((k*(plot+1))+2<10):
                tab.append("0"+str((k*(plot+1))+2)+"|"+litera)
                #print("0"+str((k*(plot+1))+2)+"|"+litera)
            else:
                tab.append(str((k*(plot+1))+2)+"|"+litera)
            k = k+1
if (reszta == 3):
    for litera in text:
        if (i<ile+1):
            if(i * (plot + 1)<10):
                tab.append("0"+str(i * (plot + 1)) + "|" + litera)
                #print("0"+str(i * (plot + 1)) + "|" + litera)
            else:
                tab.append(str(i*(plot+1))+"|"+litera)
            i = i+1
        elif (i==ile+1 and j<ile*2+1):
            if(math.ceil((j * (plot + 1) / 2)) + 1<10):
                tab.append("0"+str(math.ceil((j * (plot + 1) / 2)) + 1) + "|" + litera)
                #print(("0"+str(math.ceil((j * (plot + 1) / 2)) + 1) + "|" + litera))
            else:
                tab.append(str(math.ceil((j*(plot+1)/2))+1)+"|"+litera)
            j = j+1
        elif (j==ile*2+1 and k<ile+1):
            if((k*(plot+1))+2<10):
                tab.append("0"+str((k*(plot+1))+2)+"|"+litera)
                #print("0"+str((k*(plot+1))+2)+"|"+litera)
            else:
                tab.append(str((k*(plot+1))+2)+"|"+litera)
            k = k+1

fulltext = ""
tab.sort()

for xd in tab:
    if(int(xd.split("|")[0])<len(text)):
        fulltext = fulltext + xd.split("|")[1]

print(fulltext)

Copyrights 2014-2020 © Wklejaj.pl Wszelkie prawa zastrzeżone.