Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package dolgozat;
- import java.util.Random;
- import java.util.Scanner;
- /**
- *
- * @author szasz
- */
- public class SzaszTibor2020_02_26 {
- public static void main(String[] args) {
- bekérés();
- }
- static int bekérés(){
- Scanner beolvasó=new Scanner(System.in);
- int darab=0;
- System.out.println("Hány pénzfeldobást szerten?");
- darab=beolvasó.nextInt();
- while(darab<=0){
- System.out.println("Hibás számot adott meg! Kérek egy másikat:");
- darab=beolvasó.nextInt();
- }
- return darab;
- }
- static int pénzfeldobás(){
- int fej=0;
- int írás=0;
- int összeg;
- Random véletlen=new Random();
- for (int i = 0; i < bekérés(); i++) {
- összeg++;
- }
- return összeg;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement