Sie sind auf Seite 1von 1

Scanner in = new Scanner(System.

in);
for(int i=1;i<6;i++){
for(int k=1;k<i;k++){
if(k<=i)System.out.print("0");
}
System.out.println("1");
}
Scanner in = new Scanner(System.in);
int a;
a = in.nextInt();
if(a==1)System.out.println("January");
else if(a==2)System.out.println("February");
else if(a==3)System.out.println("March");
else if(a==4)System.out.println("April");
else if(a==5)System.out.println("May");
else if(a==6)System.out.println("June");
else if(a==7)System.out.println("July");
else if(a==8)System.out.println("August");
else if(a==9)System.out.println("September");
else if(a==10)System.out.println("October");
else if(a==11)System.out.println("November");
else if(a==12)System.out.println("December");
Scanner in = new Scanner(System.in);
double a,b,c;
double d = 0;
double e = 0;
double f = 0;
System.out.println("Enter a:");
a = in.nextDouble();
System.out.println("Enter b:");
b = in.nextDouble();
System.out.println("Enter c:");
c = in.nextDouble();
d = (b*b)-(4*a*c);
e = (-b+Math.sqrt(d))/2*a;
f = (-b-(Math.sqrt(d)))/2*a;
if(d>0)System.out.println("1st root:"+e+"\n"+"2nd root:"+f+"\n"+" The eq
uation has two real roots.");
else if(d<0)System.out.println("1st root:"+e+"\n"+"2nd root:"+f+"\n"+"Th
e equation has two complex roots.");
else if(d==0)System.out.println("1st root:"+e+"\n"+"2nd root:"+f+"\n"+"T
he equation has a single root.");

Das könnte Ihnen auch gefallen