Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static double[][] task35(int n) {
- double[][] ans = new double[n][n];
- int counter =0;
- for (int i = 0; i < n; ++i){
- for (int j = 0; j < n; ++j) {
- ans[i][j] = Math.sin((double) (i*i-j*j)/n);
- if (ans[i][j] > 0) {
- counter++;
- }
- }
- }
- System.out.println("Amount of positive elements: " + counter);
- return ans;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement