(다른문제) 정상적으로 잘되는데 왜 wrong answer인가요..? 하ㅠㅠ

kassuass Reply 8 years 33 weeks ago
import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner First = new Scanner(System.in); double a = First.nextDouble(); double b = First.nextDouble(); double c = First.nextDouble(); double d = First.nextDouble(); double e = First.nextDouble(); double f = First.nextDouble(); double cramer = ((a*d) - (b*c)); double x = ((e*d - b*f)) / cramer; double y = ((a*f - e*c)) / cramer; if (cramer == 0){ System.out.printf("no solution");} if (!(cramer == 0)){ if (x>y){ System.out.printf("%d ",(int)(x)); System.out.printf("%d", (int)(y)); } else System.out.printf("%d ",(int)(y)); System.out.printf("%d", (int)(x)); return; } } }
pichulia Reply 8 years 33 weeks ago
숫자가 3번 출력되는 경우가 있을 수 있겠네요...
kassuass Reply 8 years 33 weeks ago
감사합니다!