ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/dinfo/dec29.c
Revision: 1.1
Committed: Mon Aug 25 00:07:25 2003 UTC (20 years, 8 months ago) by root
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Log Message:
*** empty log message ***

File Contents

# Content
1 #include <stdio.h>
2
3 int main(void)
4 {
5 unsigned long long reg;
6 int B = 0;
7 int c;
8
9 while ((c = getchar ()) != EOF)
10 {
11 reg >>= 24; B += 24;
12 reg |= ((unsigned long long)c) << (64 - 3*8);
13 c = getchar ();
14 reg |= ((unsigned long long)c) << (64 - 2*8);
15 c = getchar ();
16 reg |= ((unsigned long long)c) << (64 - 1*8);
17
18 if (B >= 29)
19 {
20 int w = reg >> (64 - B);
21 int r = (w & 0x3ffffff) / 3000;
22 int b = (w & 0x3ffffff) % 3000;
23 int f = (w >> 26) & 3;
24 int g = (w >> 28) & 1;
25
26 printf ("%d %d %d %d\n", b, r, f, g);
27
28 B -= 29;
29 }
30 }
31 }