Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.48 KB | None | 0 0
  1. public class MysteriousClass
  2. {
  3.    public static void main(String[] args)
  4.    {
  5.       int i = 20;
  6.       int b = m2(i);
  7.       System.out.println(b + i);
  8.    }
  9.  
  10.    public static int m1(int i)
  11.    {
  12.       int n = 0;
  13.       while (n * n <= i)
  14.       {
  15.          n++;
  16.       }
  17.       return n - 1;
  18.    }
  19.  
  20.    public static int m2(int a)
  21.    {
  22.       int b = 0;
  23.       for (int n = 0; n < a; n++)
  24.       {
  25.          int i = m1(n);
  26.          b = b + i;
  27.       }
  28.       return b;
  29.    }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement