Advertisement
LightProgrammer000

Apresentação de boletim

May 18th, 2020
2,090
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.28 KB | None | 0 0
  1. /// Bibliotecas
  2. #include <stdio.h>
  3. #include <locale.h>
  4. #include <stdlib.h>
  5.  
  6. /// Programa
  7. int main ( int argc, char *argv [] )
  8. {
  9.     // Variáveis
  10.     int i, j;
  11.     float nota[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };// Vetor (lista)
  12.     float boletim[7][9] = { { 1, 7, 3, 2, 4, 2, 5, 6, 5 },
  13.                             { 2, 8, 7, 3, 5, 4, 3, 8, 4 },
  14.                             { 3, 9, 3, 4, 3, 6, 2, 5, 2 },
  15.                             { 4, 1, 5, 5, 5, 5, 1, 3, 6 },
  16.                             { 5, 2, 4, 4, 2, 6, 7, 8, 8 },
  17.                             { 6, 6, 3, 7, 2, 7, 8, 2, 5 },
  18.                             { 7, 8, 2, 8, 1, 8, 9, 1, 3 }
  19.                           };// 7 -> Linha | 9 -> Coluna
  20.  
  21.     // Configurações Idioma
  22.     setlocale(LC_ALL, "Portuguese");
  23.  
  24.     //////////////// Vetores ////////////////
  25.     putchar('\n');
  26.     printf("\n - Nota[%d]: %.0f", 1 , nota[0] );
  27.     printf("\n - Nota[%d]: %.0f", 1 , nota[1] );
  28.     printf("\n - Nota[%d]: %.0f", 2 , nota[2] );
  29.     printf("\n - Nota[%d]: %.0f", 3 , nota[3] );
  30.     printf("\n - Nota[%d]: %.0f", 4 , nota[4] );
  31.     printf("\n - Nota[%d]: %.0f", 5 , nota[5] );
  32.     printf("\n - Nota[%d]: %.0f", 6 , nota[6] );
  33.     printf("\n - Nota[%d]: %.0f", 7 , nota[7] );
  34.     printf("\n - Nota[%d]: %.0f", 8 , nota[8] );
  35.     printf("\n - Nota[%d]: %.0f", 9 , nota[9] );
  36.     putchar('\n');
  37.  
  38.     // Estrutura de Repetição
  39.     for( i = 0; i < 10 ; i ++ )
  40.     {
  41.         printf("\n - Nota[%d]: %.0f", i, nota[i]);
  42.     }
  43.     putchar('\n');
  44.  
  45.     //////////// Array MultiDimensional ////////////
  46.     putchar('\n');
  47.     printf("\n - Boletim [%d][%d]: %.0f", 0, 0, boletim[0][0] );
  48.     printf("\n - Boletim [%d][%d]: %.0f", 1, 1, boletim[1][1] );
  49.     printf("\n - Boletim [%d][%d]: %.0f", 2, 2, boletim[2][2] );
  50.     printf("\n - Boletim [%d][%d]: %.0f", 3, 3, boletim[3][3] );
  51.     printf("\n - Boletim [%d][%d]: %.0f", 4, 4, boletim[4][4] );
  52.     printf("\n - Boletim [%d][%d]: %.0f", 5, 5, boletim[5][5] );
  53.     printf("\n - Boletim [%d][%d]: %.0f", 6, 6, boletim[6][6] );
  54.     putchar('\n');
  55.  
  56.     // Estrutura de Repetição: Matriz
  57.     for( i = 0; i < 7 ; i ++ )
  58.     {
  59.         for ( j = 0; j < 9; j ++ )
  60.         {
  61.             printf("\n - Nota[%d][%d]: %.0f", (i+1), (j+1) , boletim[i][j] );
  62.         }
  63.     }
  64.  
  65.     return(0);
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement