第1章命题逻辑1#include#include#include#defineMAX_STACK_SIZE100typedefintElemType;typedefstruct{ElemTypedata[MAX_STACK_SIZE];inttop;}Stack;voidInitStack(Stack*S){S->top=-1;}intPush(Stack*S,ElemTypex){if(S->top==MAX_STACK_SIZE-1){printf("\nStackisfull
");return0;}S->top++;S->data[S->top]=x;return1;}intEmpty(Stack*S){return(S->top==-1);}intPop(Stack*S,ElemType*x){if(Empty(S)){printf("\nStackisfree
");return0;}*x=S->data[S->top];S->top--;return1;}voidconversion(intN){inte;Stack*S=(Stack*)malloc(sizeof(Stack));InitStack(S);while(N){第1章命题逻辑2Push(S,N%2);N=N/2;}while(
Empty(S)){Pop(S,&e);printf("%d",e);}}voidmain(){intn;printf("请输入待转换的值n:\n");scanf("%d",&n);conversion(n);}习题1
判断下列语句是否是命题,为什么
若是命题,判断是简单命题还是复合命题
(1)离散数学是计算机专业的一门必修课
(2)李梅能歌善舞
(3)这朵花真美丽
(4)3+2>6
(5)只要我有时间,我就来看你
(6)x=5
(7)尽管他有病,但他仍坚持工作