Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package it.franksisca.test;
- import org.junit.After;
- import org.junit.Before;
- import org.junit.Test;
- public class Custom {
- int[] array = { 20, 22, 52, 48, 96, 124, 154, 78, 232, 19, 60, 90, 49, 11, 3, 86, 116, 93, 63, 4 };
- @Before
- public void beforeTest() {
- System.out.println("Before");
- System.out.println(array.length);
- }
- @After
- public void afterTest() {
- System.out.println("After");
- }
- @Test
- public void customTest() {
- for (int i = 0; i < array.length; i++) {
- for (int j = i+1; j < array.length; j++) {
- if (Math.abs(array[i] - array[j]) % 30 == 0) {
- System.out.println("Hai trovato due numeri che hanno una diferenza che รจ multiplo di 30");
- System.out.println("[" + array[i] + " - " + array[j] + "]");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement