Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //какая-то магия, но это работает
- public class untitled {
- public static void main (String[] args) {
- int c = 1;
- int [] num = new int[] {30,42,70,35,90};
- int g = 0;
- while (g<3) {
- for (int i = 0; i < num.length; i++) {
- if (yes(num[i], c)) {
- g++;
- }
- }
- if (g<3){
- g = 0;
- c++;
- }
- }
- System.out.print(c);
- }
- public static boolean yes (int a, int b){
- int c = b%a;
- boolean flag = false;
- if(c==0){
- flag = true;
- }
- return flag;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement