SHOW:
|
|
- or go back to the newest paste.
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 | ||
15 | struct{ | |
16 | int cod; | |
17 | int qtd; | |
18 | int cpf; | |
19 | }compra[2]; | |
20 | ||
21 | int i, j; | |
22 | ||
23 | ||
24 | for(j=1; j<3;j++) { | |
25 | printf ("Digite os dados do cliente %d na forma: \n Nome, CPF, RG, Cidade:\n", j); | |
26 | scanf ("%s %d %d %s", &data[j].nome[j],&data[j].cpf, &data[j].rg, &data[j].cidade[j]); | |
27 | compra[j].cod = 0 + j; | |
28 | } srand (time(NULL)); | |
29 | ||
30 | for (i=0;i<1; i++){ | |
31 | system("cls"); | |
32 | if (compra[i].qtd >= 5) | |
33 | if (data[i].cpf == compra[i].cpf ) | |
34 | printf ("O vencedor da Ferrari F-50 é o código: \n :::( %d )::: \n\n\", (rand() % 10000)+1"); | |
35 | } | |
36 | return 0; | |
37 | } |