bad operand types for binary operator >=, -, *

后端 未结 4 1025
遥遥无期
遥遥无期 2021-01-29 07:36

I\'m having trouble figuring out how to fix these errors I keep getting for my code

import java.util.Scanner;

public class Unit02Prog1 {

    public static void         


        
4条回答
  •  粉色の甜心
    2021-01-29 07:59

    numWords is a String, not an int. Parse the String to get an int.

    int num_words = Integer.parseInt(numWords);
    

提交回复
热议问题