Untitled
unknown
java
a year ago
677 B
3
Indexable
import java.util.Scanner; public class P1 { public static void Sol(int a, int b) { if (a != 0) { if (b != 0) { System.out.println("x = " + (-b * 1.0) / a); } else { System.out.println("x = " + 0); } } else { if (b != 0) System.out.println("Phuong trinh vo nghiem"); else System.out.println("Phuong trinh vo so nghiem"); } } public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); // System.out.println(Sol(n)); Sol(a, b); // if (Sol(n)) { // System.out.println("YES"); // } else { // System.out.println("NO"); // } } }
Editor is loading...
Leave a Comment