1 条题解
-
0
C++ :
#include <bits/stdc++.h> using namespace std; int main() { int k; //freopen("F:\\QQDownlaod\\Laputa\\2015.3.23\\my1\\data.in","r",stdin); //freopen("F:\\QQDownlaod\\Laputa\\2015.3.23\\my1\\data.out","w",stdout); while(~scanf("%d",&k)){ char a[7][30]={ {"+------------------------+"}, {"|#.#.#.#.#.#.#.#.#.#.#.|D|)"}, {"|#.#.#.#.#.#.#.#.#.#.#.|.|"}, {"|#.......................|"}, {"|#.#.#.#.#.#.#.#.#.#.#.|.|)"}, {"+------------------------+"} }; int x=1,y=1; while(k>0){ if (a[x][y]=='#'){ a[x][y]='O'; k--; } if (x==4){ x=1; y++; } else x++; } for (int i=0;i<6;i++){ printf("%s",a[i]); printf("\n"); } } return 0; }
- 1
信息
- ID
- 883
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- (无)
- 标签
- 递交数
- 0
- 已通过
- 0
- 上传者