Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main(){
  5.  
  6.     int n=3;
  7.     int lin = n*2;
  8.     int col = 6;
  9.     int matriz[lin+1][col+1];
  10.  
  11.     for(int i=1; i<=lin; i++){
  12.         cout <<"\n";
  13.         for(int j=1; j<=col; j++){
  14.  
  15.             if((i==1) || (i==col)){
  16.                 cout << " 1 ";
  17.             }
  18.             if((i==2) || (i==(col-1))){
  19.                 if( (j==1) || (j==6) ){
  20.                    cout << " 1 ";
  21.                 }else{
  22.                     cout << " 2 ";
  23.                 }
  24.             }
  25.             if((i==3) || (i==(col-2))){
  26.                 if( (j==1) || (j==6) ){
  27.                    cout << " 1 ";
  28.                 }else if( (j==2) || (j==5)){
  29.                     cout << " 2 ";
  30.                 }else{
  31.                     cout << " 3 ";
  32.                 }
  33.             }
  34.  
  35.       }
  36.     }
  37.    getchar();
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement