69,382
社区成员
发帖
与我相关
我的任务
分享
#include<stdio.h>
#include<string.h>
int main(void)
{
bool A = true;
bool B = false;
bool C = true;
char tmp[20];
char DCmd[100];
if(A)
{
sprintf(tmp, "-d%s ", "A");
strcat(DCmd, tmp);
}
if(B)
{
sprintf(tmp, "-d%s ", "B");
strcat(DCmd, tmp);
}
if(C)
{
sprintf(tmp, "-d%s ", "C");
strcat(DCmd, tmp);
}
puts(DCmd);
return 0;
}