跑一遍程序#include <stdio.h> #define o0000 'k' #define o000o 'j' #define o000O 'h' #define o00o0 'l' #define o00oo '*' #define o00oO ' ' #define o00O0 '#' #define o00Oo 0 #define o00OO 7 #define o0o00 8 #define o0o0o 64 int main(void){const char *o0o0O="aL0JF7eALa88v7uAr806JhUqAtWKHWDV1Mig2GrAw4fRpoN4K"; char o0oo0[]=" ******* * **** * **** * *** *# *** *** *** *********"; int o0ooo=o00Oo,o0ooO=o00Oo;int o0oO0=o00Oo;while(!o00Oo){char o0oOo=getchar(); switch(o0oOo){case o0000:--o0ooO;break;case o000o:++o0ooO;break; case o000O:--o0ooo;break;case o00o0:++o0ooo;break;default:goto o0oOO;break;}if(o0ooo<o00Oo||o0ooo>o00OO)goto o0oOO;if(o0ooO<o00Oo||o0ooO>o00OO) goto o0oOO;int o0O00=o0ooo+o0ooO*o0o00;switch(o0oo0[o0O00]){case o00oo:goto o0oOO;case o00oO:o0oo0[o0O00]=o0o0O[o0oO0++];break;case o00O0:goto o0O0O;break;default:goto o0oOO;}}o0O0O:for(int o0O0o=o00Oo;o0O0o<o0o0o;++o0O0o)if(o0oo0[o0O0o]==o00oO||o0oo0[o0O0o]==o00oo)o0oo0[o0O0o]=o0o0O[o0oO0++];puts("Good End!");printf("Your flag is : flag{%s}\n", o0oo0);return 0;o0oOO:puts("Bad End!");return 0;}
时间: 2023-07-23 12:50:11 浏览: 216
这是一个 C 语言程序,主要作用是通过输入 WASD 键盘操作来移动一个小人,最终在一个地图上拼出一句话,然后输出 flag。程序的具体实现方式是通过一个 ASCII 码的地图数组 o0oo0
,将小人用 *
表示,空地用空格表示,障碍物用 #
表示。输入 WASD 键盘操作后,程序会修改小人的位置,并且在相应位置输出地图数组中的字符。
最终输出 flag 的方式是将地图数组中除了障碍物和小人的字符替换成一个字符串 aL0JF7eALa88v7uAr806JhUqAtWKHWDV1Mig2GrAw4fRpoN4K
中的字符。最终替换完毕后,输出 flag。
需要注意的是,这段程序是一个有趣的代码迷游戏,其中包含了多个结局和反常识的设计,需要好好体验一下。
相关问题
给出<Arduino.h>和<inttypes.h>和 <Stream.h>3个头文件的代码
以下是<Arduino.h>头文件的代码示例:
#ifndef Arduino_h
#define Arduino_h
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <math.h>
#include <stdint.h>
#include <stdio.h>
#include <stdarg.h>
#include "binary.h"
#include "itoa.h"
#include "pins_arduino.h"
#include "wiring.h"
#include "wiring_analog.h"
#include "wiring_digital.h"
#include "wiring_pulse.h"
#include "wiring_shift.h"
#include "WInterrupts.h"
#ifdef __cplusplus
extern "C"{
#endif
void setup(void);
void loop(void);
#ifdef __cplusplus
} // extern "C"
#endif
#endif
以下是<inttypes.h>头文件的代码示例:
#ifndef _INTTYPES_H_
#define _INTTYPES_H_
#include <stdint.h>
#define PRId8 "d"
#define PRId16 "d"
#define PRId32 "ld"
#define PRId64 "lld"
#define PRIi8 "i"
#define PRIi16 "i"
#define PRIi32 "li"
#define PRIi64 "lli"
#define PRIo8 "o"
#define PRIo16 "o"
#define PRIo32 "lo"
#define PRIo64 "llo"
#define PRIu8 "u"
#define PRIu16 "u"
#define PRIu32 "lu"
#define PRIu64 "llu"
#define PRIx8 "x"
#define PRIx16 "x"
#define PRIx32 "lx"
#define PRIx64 "llx"
#define PRIX8 "X"
#define PRIX16 "X"
#define PRIX32 "lX"
#define PRIX64 "llX"
#define PRIdPTR "ld"
#define PRIiPTR "li"
#define PRIoPTR "lo"
#define PRIuPTR "lu"
#define PRIxPTR "lx"
#define PRIXPTR "lX"
#define SCNd8 "hhd"
#define SCNd16 "hd"
#define SCNd32 "ld"
#define SCNd64 "lld"
#define SCNi8 "hhi"
#define SCNi16 "hi"
#define SCNi32 "li"
#define SCNi64 "lli"
#define SCNo8 "hho"
#define SCNo16 "ho"
#define SCNo32 "lo"
#define SCNo64 "llo"
#define SCNu8 "hhu"
#define SCNu16 "hu"
#define SCNu32 "lu"
#define SCNu64 "llu"
#define SCNx8 "hhx"
#define SCNx16 "hx"
#define SCNx32 "lx"
#define SCNx64 "llx"
#define SCNdPTR "ld"
#define SCNiPTR "li"
#define SCNoPTR "lo"
#define SCNuPTR "lu"
#define SCNxPTR "lx"
#endif
以下是<Stream.h>头文件的代码示例:
/*
Stream.h - library for stream base class
Copyright (C) 2006-2009 David A. Mellis
Modified 23 November 2010 by Mark Sproul
Modified 3 December 2017 by Chuck Todd
*/
#ifndef Stream_h
#define Stream_h
#include "Print.h"
#define DEC 10
#define HEX 16
#define OCT 8
#define BIN 2
class Stream : public Print
{
public:
virtual int available() = 0;
virtual int read() = 0;
virtual int peek() = 0;
virtual void flush() = 0;
};
#endif
相关推荐

















