Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
public class Quadrat
{
static int quadrat( int n)
{
return n*n;
}
static void ausgabe( int n)
{
String s;
int i;
for (i=1, i <= n; i=i+1 )
{
s= "Quadrat("
+i
+ ")="
+ quadrat(i);
System.out.println(s);
}
}
public static void main( String args[])
{
ausgabe(4);
}
}
Quadrat.java:1: illegal character: \187
´╗┐public class Quadrat
^
Quadrat.java:1: illegal character: \191
´╗┐public class Quadrat
^
Quadrat.java:13: not a statement
for (i=1, i <= n; i=i+1 )
^
Quadrat.java:13: ';' expected
for (i=1, i <= n; i=i+1 )
^
4 errors
public class Quadrat
{
static int quadrat( int n)
{
return n*n;
}
static void ausgabe( int n)
{
String s;
int i;
for (i=1; i <= n; i=i+1 )
{
s= "Quadrat("
+i
+ ")="
+ quadrat(i);
System.out.println(s);
}
}
public static void main( String args[])
{
ausgabe(4);
}
}
import HUMath.Algebra.*;
public class sortt {
public static void main(String[] args)
{
System.out.println("Bitte geben Sie die Groesse der nxn Matrix an:");
int n = B.readint();
System.out.println("Die Groesse der Matrix soll "+n+"x"+n+" sein!");
DM matrix = new DM(n,n);
for(int j = 1; j<=n; j++)
{
matrix.mat[j][1] = 1 + (j-1)*0.1;
matrix.mat[j][n] = 1 - (n-j)*0.1;
matrix.mat[j][j] = 1.0;
}
DM.write(matrix);
}
public static void bubbleSort(int[] sammlung)
{
int temp;
for (int i = 0; i < sammlung.length; i++)
for (int j = 0; j < sammlung.length-1; j++)
if (sammlung[j+1] < (sammlung[j]))
{ // vergleichen
temp = sammlung[j+1]; // austauschen
sammlung[j+1] = sammlung[j];
sammlung[j] = temp;
}
}
}