0
0 Комментариев

Помогите конвертировать код из python в java

def main():
 
    username = input("Please enter your name, and I'll convert it to a number: ")
    usernumber = 0  # initialize
    for character in username:
        # convert to lower case...
        # convert to ordinal form
        # subtract so that a = 1
        # add to total
        if character != " ":
            usernumber = usernumber + ord(character.lower()) - 96
    print(usernumber)
 
if __name__ == "__main__":
    main()


Добавить комментарий