Advertisement
GustStehling

Untitled

May 17th, 2014
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4. #define a 40
  5. #include <locale.h>
  6. int main (){
  7.     setlocale(LC_ALL,"Portuguese");
  8.         struct {
  9.         char nome [a];
  10.         int cpf;
  11.         char rg[a];
  12.         char cidade[a];
  13.     } data[2] ;
  14.      struct{
  15.             int cod;
  16.             int qtd;
  17.             int cpf;
  18.         }compra[2];
  19.     int i, j;
  20. for(j=1; j<3;j++) {
  21.         printf ("Digite os dados do cliente %d na forma: \n Nome, CPF, RG, Cidade:\n", j);
  22.     scanf ("%s %d %d %s", &data[j].nome[j],&data[j].cpf, &data[j].rg, &data[j].cidade[j]);
  23.     compra[j].cod =  0 + j;
  24. }   srand (time(NULL));
  25.     for (i=0;i<1; i++){
  26. system("cls");
  27.         if (compra[i].qtd >= 5)
  28.             if (data[i].cpf == compra[i].cpf )
  29.             printf ("O vencedor da Ferrari F-50 é o código: \n :::( %d )::: \n\n\", (rand() % 10000)+1");
  30.     }
  31.     return 0;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement