UVa 1587 - Box
来源:互联网 发布:win系统传文件到mac 编辑:程序博客网 时间:2024/05/02 00:11
长方体的判断,不难。
#include<stdio.h>int w[7],h[7];int min(int str1[],int str2[]){ int i,temp; for(i=0; i<6; i++) { if(str1[i]>str2[i]) { temp=str1[i]; str1[i]=str2[i]; str2[i]=temp; } }}int sort(int str1[],int str2[]){ int i,j,temp; for(i=1; i<6; i++) for(j=0; j<i; j++) { if(str1[j]>str1[i]) { temp=str1[i]; str1[i]=str1[j]; str1[j]=temp; temp=str2[i]; str2[i]=str2[j]; str2[j]=temp; } if(str2[j]>str2[i]) { temp=str2[i]; str2[i]=str2[j]; str2[j]=temp; temp=str1[i]; str1[i]=str1[j]; str1[j]=temp; } }}int main(){ int i; while (scanf("%d%d",&w[0],&h[0])!=EOF) { int a=0,b=0,c=0,d=0,q; for(i=1; i<6; i++) scanf("%d%d",&w[i],&h[i]); min(w,h); sort(w,h); for(i=0; i<5; i+=2) { if(w[i]==w[i+1]&&h[i]==h[i+1]) q=1; else { q=0; break; } } if(q) { if(w[0]==w[2]&&h[2]==h[4]&&h[0]==w[4]) q=1; else q=0; } if(q) printf("POSSIBLE\n"); else printf("IMPOSSIBLE\n"); } return 0;}
0 0
- uva 1587 - Box
- uva 1587 - Box
- UVa 1587 - Box
- UVa 1587 - Box
- UVa 1587 Box
- Uva-1587-Box-AC
- UVA - 1587 Box
- UVa 1587 Box
- Box UVa 1587
- UVA - 1587 Box 麻烦
- UVa 1587 - Box
- UVa 1587 - Box
- UVa-1587 - Box
- UVa 1587 Box
- Uva - 1587 - Box
- UVA - 1587 Box
- UVA 1587 BOX
- UVa 1587 BOX
- 关于adr指令的理解
- 【Visual C++】游戏开发笔记之五——游戏画面绘图(二)绘制位图
- 2014-10-17日深圳威通科技笔试记录
- hdu 4957 贪心破木桶接水大trick
- CentOS-6.3安装配置JDK-7
- UVa 1587 - Box
- day54,page70
- Qt音乐播放器制作(一)Easy Player
- CSS学习笔记01-块元素和内联元素.html
- 数据的表示
- Spring4.x IOC容器的初始化,开启log4j日志
- hadoop2.4.0 安装配置
- UVA - 10054 The Necklace
- uva10131