Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Programa LEVEL B //
- // Biblioteca
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int i;
- /*
- [4] -> LINHA
- [2] -> COLUNAS
- [11] -> ELEMENTOS (Quantidade de caracteres)
- */
- char president[4][2][11] = {"George", "Washington",
- "John", "Adams",
- "Thomas", "Jefferson",
- "James", "Monroe"
- };
- /*
- COLUNA 0 COLUNA 1
- LINHA 0 George(6+1) Washington(10+1)
- LINHA 1 John(4+1) Adams(5+1)
- LINHA 2 Thomas(6+1) Jefferson(10+1)
- LINHA 3 James(5+1) Monroe(6+1)
- OBS.: Toda "String" na - Linguagem C - tem o elemento de caractere nulo "\0"
- */
- for( i = 0; i < 4; i++ )
- {
- // Saida de dados: Linha[Mutável] Coluna[0] --- Linha(Mutável] Coluna[1]
- printf("\n %-10s %-20s", president[i][0], president[i][1]);
- putchar('\n');
- }
- return(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement