| | |
how to eliminate number
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Aug 2008
Posts: 51
Reputation:
Solved Threads: 0
•
•
•
•
Which container do you use to store the number? vector? list?
if you use list, you can use the unique(op) function to eliminate the duplicate number. the op is a function or a functional object used to predicate whether two number is equivalent.
C++ Syntax (Toggle Plain Text)
void equiv(int *x, int start, int n) { write(x, n); if (start < n) { int i, j; for (i = n-2; i > start; i--) { for (j = i + 1; j <n; ++j) { shift(x, i, j); equiv(x, i, n); } shiftleft(x, i, n); } }}
the output is same as before.
Last edited by Ancient Dragon; Aug 27th, 2008 at 10:03 am. Reason: correct code tags -- spaces not allowed between brackets
•
•
Join Date: Aug 2008
Posts: 51
Reputation:
Solved Threads: 0
•
•
•
•
You aren't talking about sofic shifts, are you? If so, how are you representing your graphs?
1234
1243
1423
1432.
but i dont want all this four because there is equivalent among them.
for example 1234 ==1432. i have to delete 1432.
![]() |
Similar Threads
- Too Bizarre too Bizarre (Geeks' Lounge)
- Prime Numbers (Python)
- Prime Number (Posting Games)
- My prime Number generator (Python)
- Today Question (C)
- how to eliminate all keyboard inputs accept a certain range (C)
- Installing Program to Harddrive, in order to eliminate the need for disc (Computer Science)
Other Threads in the C++ Forum
- Previous Thread: Segmentation Fault
- Next Thread: trying to print my Queue
| Thread Tools | Search this Thread |
api array arrays based beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete deploy developer dll download dynamiccharacterarray email encryption error file forms fstream function functions game generator getline givemetehcodez graph gui homeworkhelp homeworkhelper iamthwee ifstream input int java lib list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg sorting string strings temperature template text text-file tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






