| | |
how to eliminate number
Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
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
Views: 599 | Replies: 7
| Thread Tools | Search this Thread |
Tag cloud for C++
6 add api array arrays beginner binary c++ c/c++ calculator char class classes code compile compiler console conversion convert count data delete desktop directshow dll download dynamic encryption error file forms fstream function functions game givemetehcodez google graph gui iamthwee ifstream input int integer java lib library linkedlist linker linux loop looping loops map math matrix memory microsoft newbie news number output parameter pointer problem program programming project python random read recursion recursive reference return sort stream string strings struct studio system template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






