å ´ååããé å¼µããï¼
åé¡æ¦è¦
3 ã¤ã®æ´æ° ãããã¤ãã®ã°ã«ã¼ãã«åãã¦ãåã°ã«ã¼ãã«å«ã¾ããæ´æ°ã®ç·åãçããã§ããããå¤å®ããã
èãããã¨
次㮠2 ã¤ã®å ´åãèããããã
- 2 ã¤ã®ã°ã«ã¼ãã«åãã¦ãç·åãçãããã
- 3 ã¤ã®ã°ã«ã¼ãã«åãã¦ãç·åãçãããã
åè ã«ã¤ãã¦ã¯ãããã«æ¬¡ã® 3 ã¤ã«åããããããããã®æ¡ä»¶ãæºããã°è¯ãã
å¾è ã®æ¡ä»¶ã¯
ã¨æ¸ãããC++ ã§ã¯ if (A == B && B == C)
ãªã©ã¨æ¸ããã¨ã§å¤å®ã§ããã
ã³ã¼ã
#include <bits/stdc++.h> using namespace std; int main() { int A, B, C; cin >> A >> B >> C; if (A == B + C || B == C + A || C == A + B) { // 2 ã°ã«ã¼ãã«åããå ´å cout << "Yes" << endl; } else if (A == B && B == C) { // 3 ã°ã«ã¼ãã«åããå ´å cout << "Yes" << endl; } else { cout << "No" << endl; } }