[백준] 배수와 약수

jun·2021년 4월 7일
0
post-thumbnail

유의할점

풀이

코드

C++


#include <iostream>

using namespace std;

int main() {
	int a;
	int b;
	while (1) {
		cin >> a >> b;
		if (a == 0 && b == 0)
			break;
		if (a % b == 0)
			cout << "multiple";
		else if (b % a == 0)
			cout << "factor";
		else
			cout << "neither";
		cout << "\n";
	}
}
profile
Computer Science / Algorithm / Project / TIL

0개의 댓글