Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. public double sqrtOfSinMultByCos(double a, double b) {
  2. double sin = Math.sin(a);
  3. double cos = Math.cos(b);
  4. return Math.sqrt(sin * cos);
  5. }
  6.  
  7. public void printSqrtOfSinMultByCos(double a, double b) {
  8. double sin = Math.sin(a);
  9. double cos = Math.cos(b);
  10. System.out.println(Math.sqrt(sin * cos));
  11. }
  12.  
  13. // Найти макс. x, x <= 10, на которое делится n
  14. publiс void reportDivisibility(int n) {
  15. if (n % 10 == 0) {
  16. System.out.println("n делится на 10"); return;
  17. }
  18. // Если n делится на 10, другие условия не проверяются
  19. // TODO Добавить проверку других признаков делимости
  20. if (n % 3 == 0) {
  21. System.out.println("n делится на 3"); return;
  22. }
  23. if (n % 2 == 0) {
  24. System.out.println("n -- четное"); return;
  25. }
  26. System.out.println("n не делится на числа 2..10";
  27. }
  28.  
  29. public BigDecimal max(BigDecimal a, BigDecimal b) {
  30. if (a.compareTo(b) > 0)
  31. return a;
  32. return b;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement