Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // DLL.cpp : Defines the exported functions for the DLL application.
- //
- #include "stdafx.h"
- int Collatz(int ans)
- {
- while (ans != 1) {
- if (ans % 2 == 1)
- ans = (3 * ans) + 1;
- else
- ans /= 2;
- return ans;
- }
- return 0;
- }
- int GetInstr(int Number)
- {
- int a1 = 2;
- int b1 = 4;
- int c1 = 6;
- int d1 = 8;
- int a0 = 128;
- int b0 = 256;
- int c0 = 512;
- int d0 = 10420;
- unsigned int NUM1 = 0;
- unsigned int NUM2 = 0;
- unsigned int NUM3 = 0;
- unsigned int NUM4 = 0;
- for (int a = 10; a < a0; a++)
- {
- int p1 = a * a1 >> Numbera;
- NUM1 += Collatz(p1);
- }
- for (int b = 20; b < b0; b++)
- {
- int p2 = b * b1 ^ Number;
- NUM2 += Collatz(p2);
- }
- for (int c = 30; c < c0; c++)
- {
- int p3 = c * c1 << Number;
- NUM3 += Collatz(p3);
- }
- for (int d = 40; d < d0; d++)
- {
- int p4 = d * d1 || Number;
- NUM4 += Collatz(p4);
- }
- return (NUM1 ^ NUM4) / (NUM2 >> NUM3);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement