Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package javaapplication5;
- import java.util.*;
- public class JavaApplication5{
- public static void main(String[] args) {
- Scanner keyboard = new Scanner(System.in);
- //Deklaration der Variablen
- double x, y, z, L;
- //Eingeben der Werte
- System.out.println("Geben Sie x ein ");
- x = keyboard.nextDouble();
- System.out.println("Geben Sie y ein");
- y = keyboard.nextDouble();
- System.out.println("Geben Sie z ein");
- z = keyboard.nextDouble();
- if (x == 1 && y == 0 && z == 0)
- {
- System.out.println("Es handelt sich um einen ex Basisvektor");
- }
- if (x == 0 && y == 1 && z == 0)
- {
- System.out.println("Es handelt sich um einen ey Basisvektor");
- }
- if (x == 0 && y == 0 && z == 1)
- {
- System.out.println("Es handelt sich um einen ez Basisvektor");
- }
- L = (x*x+y*y+z*z);
- System.out.println(L);
- L = Math.sqrt(L) ;
- System.out.println("Die Länge des Vektors ist " + L);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement