CCF俄罗斯方块
来源:互联网 发布:网络社保是什么梗 编辑:程序博客网 时间:2024/05/23 12:28
心得:
记录坐标就好。
代码:
#include <cstdio>int a[20][20];int b[5][5];int pos,co;struct node{ int x,y;}c[5];int main(){ for(int i = 1;i <= 15;++i) for(int j = 1;j <= 10;++j) scanf("%d",&a[i][j]); int cnt = 0; for(int i = 1;i <= 4;++i) { for(int j = 1;j <= 4;++j) { scanf("%d",&b[i][j]); if(b[i][j]) { c[cnt].x = i; c[cnt++].y = j; } } } scanf("%d",&co); for(int i = 0;i < 4;++i) c[i].y += co - 1; while(c[0].x < 15 && c[1].x < 15 && c[2].x < 15 && c[3].x < 15) { if(!a[c[0].x + 1][c[0].y] && !a[c[1].x + 1][c[1].y] && !a[c[2].x + 1][c[2].y] && !a[c[3].x + 1][c[3].y]) { c[0].x++; c[1].x++; c[2].x++; c[3].x++; } else break; } a[c[0].x][c[0].y] = a[c[1].x][c[1].y] = a[c[2].x][c[2].y] = a[c[3].x][c[3].y] = 1; for(int i = 1;i <= 15;++i) { printf("%d",a[i][1]); for(int j = 2;j <= 10;++j) printf(" %d",a[i][j]); printf("\n"); } return 0;}
0 0
- CCF 俄罗斯方块
- CCF 俄罗斯方块
- ccf 俄罗斯方块
- CCF俄罗斯方块
- 【CCF 俄罗斯方块】
- ccf----俄罗斯方块
- CCF 俄罗斯方块
- CCF俄罗斯方块
- CCF俄罗斯方块
- CCF认证 201604 俄罗斯方块
- CCF俄罗斯方块201604-2
- CCF-201604-2-俄罗斯方块
- CCF-201604-2-俄罗斯方块
- ccf之俄罗斯方块
- CCF 201604-2 俄罗斯方块
- ccf 201604-2 俄罗斯方块
- CCF——俄罗斯方块
- CCF 201604-2 俄罗斯方块
- jFinal 的简单介绍
- Android应用优化小手册
- shell脚本中字符串常用操作整理
- 单例模式
- Python时间获取及转换知识汇总
- CCF俄罗斯方块
- SQL语句之ORDER BY子句
- 天梯赛练习——后天
- 蓝桥杯题 机器人繁殖
- Leetcode 337. House Robber III
- day7
- linux C中常用头文件说明
- c语言中getc getch getchar 的区别
- strlen和sizeof的区别