UVa 12372 - Packing for Holiday

来源:互联网 发布:位面淘宝txt八零 编辑:程序博客网 时间:2024/05/18 03:41

题目:打包行李,判断是不是能放得下,给你货物的尺寸,箱子为20*20*20尺寸。

分析:简单题。直接判断是不是三维都不超过20即可。

说明:(⊙_⊙)

#include <iostream>#include <cstdlib>#include <cstdio>using namespace std;int main(){int n,x,y,z;while (  cin >> n ) for ( int t = 1 ; t <= n ; ++ t ) {cin >> x >> y >> z;cout << "Case " << t << ": ";if ( x <= 20 && y <= 20 && z <= 20 )cout << "good\n";else cout << "bad\n";}return 0;}

0 0
原创粉丝点击