baekjoon: 19532(수학은 비대면강의입니다)

강지안·2023년 5월 13일
0

baekjoon

목록 보기
22/186

문제

코드

import java.util.Scanner;

public class q19532 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        int e = sc.nextInt();
        int f = sc.nextInt();

        for(int i=-999; i<1000; i++) {
            for(int j = -999; j<1000; j++) {
                if(a*i + b*j == c && d*i + e*j == f) {
                    System.out.print(i + " " + j);
                    break;
                }
            }
        }
    }
}

0개의 댓글