Using charAt method, won't add them as an Int, and wont print as string. Will explain better

后端 未结 4 1255
旧时难觅i
旧时难觅i 2021-01-27 17:58

Alright, so here is my code:

import java.util.Scanner;

public class CarRental {

    public static String model;
    public static int letternum;
    public st         


        
4条回答
  •  攒了一身酷
    2021-01-27 18:22

    If you add the 229 value that you to the 607 in the license plate, you get the 836 number you say you're supposed to get, so it looks like your total variable is right, but you just need to add it to the number from the input.

    The stuff everyone else is saying about shifting the ASCII values is for when you're determining the first character in the output.

提交回复
热议问题