עבור לתוכן

בעיה בתרגיל פשוט בJAVA

Featured Replies

פורסם

יש לי איזה בעיה עם הסוגריים לא הבנתי בדיוק טעות טיפשית

import java.util.*;

public class MyClass {
static scanner reader= new scanner(system.in);
public static void main() {
int a,b,c,d;
double avg;
for (int i=1; i<20; i++)
{
System.out.println ("how many goals in game1");
a=reader.nextInt();
System.out.println ("how many goals in game2");
b=reader.nextInt();
System.out.println ("how many goals in game3");
c=reader.nextInt();
d=(a+b+c);
avg=(d/3);
System.out.println ("the number of player is and the avg is"+ i+avg);
if ((a=0) // (b=0) // (c=0))
{
System.out.println ("lo evkia");
}
if (d>5)
{
System.out.println ("player miztayen");
}
}

}
}

פורסם

השורה הזו:

if ((a=0) // (b=0) // (c=0))

שגויה.

// זה סימון של הערה.

|| זה סימון עבור "או" לוגי.

להבא, תכתוב גם מהי הודעת השגיאה.

פורסם
  • מחבר

עכשיו קיבלתי עוד שגיאה:

java.lang.NoClassDefFoundError: scanner Either the class declaration or import is missing, or there is a circular dependency between classes and the interpreter cannot handle it correctly.

פורסם
  • מחבר

אוקיי מצאתי עוד כמה שגיאות טיפשיות = אחד ועוד כמה טיפוסים שרשמתי באות קטנה :kopfpatsch:

כל מקרה עכשיו זה עובר תודה

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים