Untitled

mail@pastecode.io avatar
unknown
java
a month ago
847 B
0
Indexable
Never
import java.util.Scanner;
public class Main {
    public static double function1(double a, double b){ 
        double func1 = (Math.sin(a) * Math.sin(a)) + (Math.cos(b) * Math.cos(b));  
        return func1;
    }
    public static double function2(){ 
        double func2 = (Math.sin(-1) + Math.cos(-1) + Math.sin(0) + Math.cos(0) + Math.sin(1) + Math.cos(1) + Math.sin(2) + Math.cos(2) + Math.sin(3) + Math.cos(3));   
        return func2;
    }
    
    public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    double a = in.nextDouble();
    double b = in.nextDouble();
    double result = function1(a,b);
    System.out.println(result);
    
    double result2 = function2();
    if (result2 == 0){
        System.out.println("Дробь равна нулю");
    } 
    System.out.println(result2);
    
}

}
Leave a Comment