這題挺有意思的ios
// 1065. A+B and C (64bit).cpp : 定義控制檯應用程序的入口點。 // #include "stdafx.h" #include <iostream> using namespace std; int main() { long long a, b, c; int n; cin >> n; for(int i = 1; i <= n; i++){ cin >> a >> b >> c; long long a1 = a / 3, b1 = b / 3, c1 = c / 3; long long a2 = a % 3, b2 = b % 3, c2 = c % 3; long long sum1 = a1 + b1 + (a2 + b2) / 3, sum2 = (a2 + b2) % 3; if(sum1 > c1 || (sum1 == c1 && sum2 > c2)) cout << "Case #" << i << ": true" << endl; else cout << "Case #" << i << ": false" << endl; } return 0; }