Skip to content

Instantly share code, notes, and snippets.

@scriptkkiddie
Created July 22, 2023 09:10
Show Gist options
  • Save scriptkkiddie/b54c731975572566737fe708547827da to your computer and use it in GitHub Desktop.
Save scriptkkiddie/b54c731975572566737fe708547827da to your computer and use it in GitHub Desktop.
Java: The Dice Problem
class Main {
    public static void main (String[] args) {

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int dice = 7;

        for(int i = 1; i <= N; i++) {
            int x = sc.nextInt();
            System.out.println(dice - x);
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment