Advertisement
Guest User

Untitled

a guest
Dec 6th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.93 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #define TAMANHO 100
  5. #define TAMANHOCAMPO 50
  6. #define SM 988.73
  7.  
  8. typedef struct funcionario {
  9.     char nome[TAMANHOCAMPO];
  10.     float salario;
  11. } FUNCIONARIO;
  12.  
  13. int main()
  14. {
  15.     int i;
  16.     FUNCIONARIO funcionarios[TAMANHO];
  17.     float Piso_Salarial = 1.85 * SM;
  18.     for(i = 0; i < TAMANHO; i++){
  19.         printf("Funcionario %i\n", i + 1);
  20.         printf("\tDigite o nome completo: ");
  21.         scanf("\n%[^\n]", funcionarios[i].nome);
  22.         printf("Digite o salario bruto: ");
  23.         scanf("%f", &funcionarios[i].salario);
  24.     }
  25.     printf("RELATORIO:\n\n");
  26.     for(i = 0; i < TAMANHO; i++){
  27.         if(funcionarios[i].salario < Piso_Salarial){
  28.             printf("Funcionario %i\n", i + 1);
  29.             printf("\tNome completo: %s\n", funcionarios[i].nome);
  30.             printf("\tSalario bruto: R$%.2f\n", funcionarios[i].salario);
  31.         }
  32.     }
  33.  
  34.     return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement