vicesource

LOL

Nov 28th, 2013
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.49 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6.     char a, vmapa[10][20];
  7.     int linhas, colunas;
  8.     FILE *mapa = fopen("mapa.txt", "rt");
  9.     for (linhas = 0; linhas < 10 ; linhas++)
  10.     {
  11.         for (colunas = 0; colunas<21; colunas++)
  12.         {
  13.             vmapa[linhas][colunas]=fgetc(mapa);
  14.         }
  15.     }
  16.     vmapa[5][5] = 'X';
  17.     for (linhas = 0; linhas < 10 ; linhas++)
  18.     {
  19.         for (colunas = 0; colunas<21; colunas++)
  20.         {
  21.             printf("%c", vmapa[linhas][colunas]);
  22.         }
  23.     }
  24.     return 0;  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment