#include <stdio.h>
#include <stdlib.h>
#include <time.h>
Go to the source code of this file.
|
| int | main (int argc, char *argv[]) |
◆ BIT
◆ BIT_CLEAR
| #define BIT_CLEAR |
( |
| x, |
|
|
| n ) |
◆ BIT_GET
◆ BIT_SET
◆ BIT_TOGGLE
| #define BIT_TOGGLE |
( |
| x, |
|
|
| n ) |
◆ BIT_WRITE
| #define BIT_WRITE |
( |
| x, |
|
|
| n, |
|
|
| v ) |
◆ ES_PAR
◆ main()
| int main |
( |
int | argc, |
|
|
char * | argv[] ) |
Definition at line 14 of file Ejemplo025.c.
15{
17 int i, nc, cc, cb;
18 srand(time(NULL));
19 i = 0;
20 do{
21 c = getchar();
22 str[i] = c;
23 i++;
24 }
while(c!=10&&i<(
N-1));
25 nc = i-1;
26 str[nc] = '\0';
27 p = 0;
28 i = 0;
29 while(str[i]!='\0')
30 {
31 p^=str[i];
32 i++;
33 }
34 printf("%s (%d)\n", str, p);
35 cc = (rand()%nc);
36 cb = (rand()%8);
38 v = p;
39 i = 0;
40 while(str[i]!='\0')
41 {
42 v^=str[i];
43 i++;
44 }
45 printf("%s (%d, %d, %d)\n", str, v, cc, cb);
46 return 0;
47}