Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <unistd.h>
- #include <fcntl.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <stdint.h>
- #include <stdbool.h>
- #include <string.h>
- uint_least32_t w;
- uint_least32_t
- safe_pow(uint_least32_t base, uint_least32_t deg)
- {
- uint_least32_t result = 1;
- while (deg--) {
- result *= base;
- }
- return result;
- }
- void
- set1(uint_least32_t *a)
- {
- while (true) {
- uint_least32_t t = *a;
- *a |= 1;
- *a <<= 1;
- if (*a == t) {
- break;
- }
- }
- }
- void
- print_octal(uint_least32_t b)
- {
- char s[34];
- for (int i = 0; i < 34; i++) {
- s[i] = '\0';
- }
- int index = 0;
- while (b != 0) {
- s[32 - 1 - index] = b % 8;
- b /= 8;
- index++
- }
- char *real_s = s + 32 - index;
- printf("%s", real_s);
- }
- void
- print_dec(uint_least32_t b)
- {
- char s[34];
- for (int i = 0; i < 34; i++) {
- s[i] = '\0';
- }
- int index = 0;
- while (b != 0) {
- s[32 - 1 - index] = b % 10;
- b /= 10;
- index++
- }
- char *real_s = s + 32 - index;
- for ()
- printf("%s", real_s);
- }
- void
- print_octal_o(uint_least32_t b)
- {
- char s[34];
- for (int i = 0; i < 34; i++) {
- s[i] = '\0';
- }
- int index = 0;
- while (b != 0) {
- s[32 - 1 - index] = b % 8;
- b /= 8;
- index++
- }
- char *real_s = s + 32 - index;
- printf("%s", real_s);
- }
- uint32_t
- reads(char *s)
- {
- uint32_t result = 0;
- int n = strlen(s);
- for (int i = n - 1; i >= 0; i--)
- {
- result += (s[i] - '0');
- result *= 10;
- }
- return result;
- }
- int
- main(int argc, char **argv)
- {
- char ss[32], nn[32], ww[32];
- uint_least32_t n, s, answer = 0;
- cout << (uint_least32_t)answer << endl;
- scanf("%s%s%s", nn, ss, ww);
- n = reads(nn);
- s = reads(ss);
- w = reads(ww);
- uint_least32_t bound = safe_pow(2, n);
- if (n == 32) {
- }
- for ( ; answer < bound; answer++) {
- print_
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement