Q8: A + B

Head: A + B problem, if A + B can be divided by 86, the output yes, on the contrary output no, each line will contain two integers A and B to the end of the process the file. For each case, if (A + B)% 86 = 0, then the output line "YES", in a row or NO output.
Solution: Enter two numbers in the cycle, and then determines whether or not the two together can be divided by 86, and then output

#include <iostream>
using namespace std;
int main()
{
	int a, b;
	while (cin>>a>>b)
	{
		if ((a + b) % 86 == 0) cout << "yes\n" ;
		else cout << "no\n" ;
	}
}

Guess you like

Origin blog.csdn.net/weixin_43981315/article/details/84876052
B