codeforces A. Bayan Bus(简单模拟)

 1 #include <queue>
 2 #include <string>
 3 #include <cstdio>
 4 #include <cstring>
 5 #include <iostream>
 6 #include <algorithm>
 7 #define N 20000
 8 using namespace std;
 9 
10 int num[5][15];
11 
12 int main()
13 {
14     int n;
15     cin>>n;
16     for(int j=1; j<=11 && n; ++j){
17         for(int i=1; i<=4; ++i){
18             if(j>1 && i==3) continue;
19             --n;
20             num[i][j] = 1;
21             if(n == 0) break;
22         }
23     } 
24 
25     printf("+------------------------+\n");
26     for(int i = 1; i<=4; ++i){
27         printf("|");
28         for(int j=1; j<=11; ++j){
29             if(num[i][j]) printf("O.");
30             else{
31                 if( i != 3 || (i==3 && j==1))
32                     printf("#.");
33                 else printf("..");
34             }
35         }
36         if(i == 1) printf("|D|)\n");
37         if(i==2) printf("|.|\n");
38         if(i==3) printf("..|\n");
39         if(i==4) printf("|.|)\n");
40     }
41     printf("+------------------------+\n");
42     return 0;
43 }

 

posted @ 2014-10-06 09:03  hjzqyx  阅读(309)  评论(0编辑  收藏  举报