Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.69 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Taschenrechner {
  3.     public static int durrchscnitt(int a, int b, int c){
  4.         int summ=a+b+c;
  5.         return summ/3;
  6.  
  7.  
  8.  
  9.     }
  10.  
  11.  
  12.     public static void main (String[] args){
  13.         Scanner scan=new Scanner(System.in);
  14.         System.out.println("Geben Sie bitte den ersten Zahl ein: ");
  15.         int zahl1=scan.nextInt();
  16.         System.out.println("Geben Sie bitte den zweiten Zahl ein: ");
  17.         int zahl2=scan.nextInt();
  18.         System.out.println("Geben Sie bitte den deritten Zahl ein: ");
  19.         int zahl3=scan.nextInt();
  20.         System.out.println("Der Durchschnitt ist: "+durrchscnitt(zahl1,zahl2,zahl3));
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.     }
  28.  
  29.  
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement