Created
October 23, 2016 11:00
-
-
Save lnsp/3197b6eaac92f210e20a98954d6cd1e9 to your computer and use it in GitHub Desktop.
Übung zu Einstieg in die Programmierung #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class JavaKurs6 { | |
public static void main(String[] args) { | |
// Nicht ändern!! | |
Scanner in = new Scanner(System.in); | |
System.out.print("Bitte gib eine Zahl ein: "); | |
int a = in.nextInt(), b = 0, c = 0, d = 0; | |
// Hier beginnt dein Code! | |
// Aufgabe 1: Das 3-fache von a ausgeben und in b abspeichern | |
// Aufgabe 2: Den Rest von a / 3 berechnen und in c abspeichern | |
// Aufgabe 3: Die Summe von b und c in d abspeichern | |
// Nicht mehr ändern!!! | |
System.out.println("b = " + b); | |
System.out.println("c = " + c); | |
System.out.println("d = " + d); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment