Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Not Common Numbers
#include<iostream> #include<conio.h> using namespace std; struct Record { int n; Record* p; Record() { cin >> n; p = NULL; } }; Record* inputVector(Record* temp) { temp = new Record(); if(temp->n != 0) temp->p = inputVector(temp->p); return temp; } bool search(Record* temp, int c) { if(temp->n == c) return true; else if(temp->p != NULL) return search(temp->p, c); else return false; } void outputNotCommon(Record* pointer1, Record* pointer2) { if(!search(pointer2, pointer1->n)) cout << pointer1->n << ' '; if(pointer1->p != NULL) outputNotCommon(pointer1->p, pointer2); } void outputVector(Record* pointer) { cout << pointer->n << ' '; if(pointer->p != NULL) outputVector(pointer->p); } void main() { Record* pointer1 = inputVector(NULL); cout << endl; Record* pointer2 = inputVector(NULL); cout << endl << endl; outputNotCommon(pointer1, pointer2); getch(); }
run
|
edit
|
history
|
help
0
hangman
fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
C++ quine
variable template not supported
<string> Indirect include of <errno.h> with VSC++
list multiply
infix to postfix v 3.0 with improved eval()
infix to postfix v 1.0
Fast sine to fill array (sin/cos pair)
iterator by value, by reference