求助大神能不能帮我把C语言改成Python 105
#include<iostream>#include<iomanip>usingnamespacestd;voiddraw(int,int);//画真值表函数voidco...
#include<iostream>#include<iomanip>using namespace std;void draw(int, int);//画真值表函数void conjon(int p, int q){ //合取 cout.width(5); cout<<int(p&&q);}void disjon(int p, int q){ //析取 cout.width(5); cout<<int(p||q);}void condi(int p, int q){ //条件 cout.width(5); cout<<int(p&&!q);}void doub_condi(int p, int q){ //双条件 if(p==q){ cout.width(5); cout<<1; } else{ cout.width(5); cout<<0;}}void draw(int p, int q){ //param:: p,q 1为true,0为false cout<<"--------------------------"<<'\n'; cout<<setw(6)<<"con"<<"dis"<<"condi"<<"dou"<<endl; cout<<"--------------------------"<<'\n'; conjon(p,q);disjon(p,q);condi(p,q);doub_condi(p,q);}int main(){ draw(1,0); return 0;}
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询