import java.io.*;
public class Ratespiel
{
public static void main(String[]args) throws IOException
{
int a,i;
int zahl,versuche,grenze;
InputStreamReader(System.in);
BufferedReader Dataln = new BufferedReader(Input);
System.out.println("Bitte geben Sie eine obere Grenze ein");
grenze =Integer.parseInt(Dataln.readLine());
System.out.println("Anzahl der Versuche eingeben");
versuche =Integer.parseInt(Dataln.readLine());
int zufall=(int)(1+Math.random()*grenze);
do
{
System.out.println("Geben Sie eine Zahl ein");
zahl = Integer.parseInt(Dataln.readLine());
if(zahl==zufall)
{
i = 0;
}
else
{
if(zufall < zahl)
{
System.out.println("Zu hoch");
}
else
{
System.out.prinln("zu klein");
}
i = versuche -1;
a=a++;
}
}
while(i != 0);
if(a==versuche)
{
System.out.println("Sie haben verloren");
}
else
{
System.out.println("Sie haben gewonnen");
}
}
}
Compiliere H:\Quellcodes\Vorlagen\Ratespiel.java mit Java-Compiler
Ratespiel.java:9:5: cannot find symbol
symbol : method InputStreamReader(java.io.InputStream)
location: class Ratespiel
InputStreamReader(System.in);
^
Ratespiel.java:10:48: cannot find symbol
symbol : variable Input
location: class Ratespiel
BufferedReader Dataln = new BufferedReader(Input);
^
Ratespiel.java:41:24: cannot find symbol
symbol : method prinln(java.lang.String)
location: class java.io.PrintStream
System.out.prinln("zu klein");
^
3 errors