Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <inttypes.h>
- int main() {
- int n, w;
- scanf("%d%d", &n, &w);
- int32_t i, tpr = 1 << n;
- int32_t c=0;
- int f=0;
- for (i = 0; i < tpr; ++i) {
- printf("|%*" PRIx32, w, i);
- printf("|%*" PRIu32, w, i);
- if(i < tpr/2) {
- printf("|%*" PRId32, w, c);
- printf("|\n");
- c++;
- }
- else {
- if(!f) {
- c=-c;
- }
- f=1;
- printf("|%*" PRId32, w, c);
- printf("|\n");
- ++c;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement