33,311
社区成员
发帖
与我相关
我的任务
分享
#ifdef _aaa_
printf("11111111111\n");
#elif _bbb_
printf("22222222222\n");
#endif
//要是像你那样写,得如下格式:
#if defined _aaaa_
printf("11111111111\n");
#elif defined _bbb_
printf("22222222222\n");
#endif
#include "stdafx.h"
#include <stdlib.h>
#define _aaa_ 1
#define _bbb_ 10
int _tmain(int argc, _TCHAR* argv[])
{
#ifdef _aaa_ //不好意思,上面这里让我没注意多写了个s
printf("11111111111\n");
#else ifdef _bbb_
printf("22222222222\n");
#endif
system("pause");
return 0;
}
#include "stdafx.h"
#include <stdlib.h>
#define _aaa_ 1
#define _bbb_ 10
int _tmain(int argc, _TCHAR* argv[])
{
#ifdef _asaa_
printf("11111111111\n");
#else ifdef _bbb_
printf("22222222222\n");
#endif
system("pause");
return 0;
}