1 #include <stdio.h> 2 #include <stdlib.h> 3 4 int main() 5 { 6 int p,q; 7 while(~scanf("%d %d",&p,&q)) 8 { 9 printf("%d %d %d %d %d %d\n",p&&q,p||q,!p||q,((!p||q)&&(!q||p)),!(p&&q),!(p||q)); 10 } 11 return 0; 12 }
1 #include <stdio.h> 2 #include <stdlib.h> 3 4 int main() 5 { 6 int p,q; 7 while(~scanf("%d %d",&p,&q)) 8 { 9 printf("%d %d %d %d %d %d\n",p&&q,p||q,!p||q,((!p||q)&&(!q||p)),!(p&&q),!(p||q)); 10 } 11 return 0; 12 }
转载于:https://www.cnblogs.com/Angfe/p/10532676.html