Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sstream>
- #include <iostream>
- #include <stdio.h>
- #include <conio.h>
- using namespace std;
- int main()
- {
- int n;
- scanf("%i",&n);
- int k;
- scanf("%i",&k);
- for (int i = 0; i < n; i++) {
- unsigned short num = 0;
- unsigned short num_2 = 1;
- num_2 = (num_2 << (16 - k));
- num = num | num_2;
- for (int g = 0; g < 16; g++) {
- unsigned short num_2 = 1;
- num_2 = (num_2 << (15 - g));
- num_2 = num & num_2;
- if (((num_2 << g) >> 15) == 1)
- printf("1");
- else
- printf("0");
- }
- printf("\n");
- }
- _getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement