12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
cpp #include <iostream> #include "decof.h" using namespace std; int main() { cout << "Hello world!" << endl; int n,j; cout<<"How many digits?"<<endl; cin>>n; int i[n],p,q[n+1],m; decof ob; for(int j=0;j<n;++j) { cin>>p; i[j]=p; } for(int j=0;j<n;++j) { cout<<i[j]; } for(int j=0;j<(n+1);++j) { if (j==0) { cin>>q[j]; } else { m= ob.xora(q[j-1],i[j-1]); } } return 0; } header fle: #ifndef DECOF_H #define DECOF_H class decof { public: decof(); virtual ~decof(); int xora(int q,int i); protected: private: }; #endif // DECOF_H decof function: #include <iostream> #include "decof.h" using namespace std; decof::decof() { //ctor } decof::~decof() { //dtor } int xora(int q,int i) { return((q||i)&&!(q&&i)); } er
int decof::xora(int q, int i)