Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Cinco {
- public static void main(String args[]) {
- Scanner x = new Scanner(System.in);
- int score = 0;
- int pos = 0;
- int indexOut[] = new int[5];
- for (int i = 0; i < indexOut.length; i++) {
- indexOut[i] = x.nextInt();
- if (i > 0) {
- indexOut[i] *= indexOut[i - 1];
- } else {
- indexOut[i] *= 3;
- }
- }
- for (int i = 0; i < indexOut.length; i++) {
- if (i < indexOut.length - 1) {
- if (indexOut[i] < indexOut[i + 1]) {
- score += 2;
- } else {
- pos += 1;
- }
- }
- }
- System.out.println("The players has a new score " + score + " but isn't good for " + pos + " reasons");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement