java neuron 需不需要归一化
发布网友
发布时间:2023-09-16 15:11
我来回答
共1个回答
热心网友
时间:2024-10-01 07:36
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import java.util.Scanner;
public class Main {
private static void Normalize(int a, int b) {
double x = a / Math.sqrt(a * a + b * b);
double y = b / Math.sqrt(a * a + b * b);
System.out.printf("%.1f + %.1fi", x, y);
}
public static void main(String[] args) {
try (Scanner sc = new Scanner(System.in)) {
int a = sc.nextInt();
int b = sc.nextInt();
Normalize(a, b);
}