0
Input:24207.Output:0 2 4 7 (the order doesnt matter )
i have to writte a program that finds the digit that and delets the copies. i have no ideea how to start .I googled the problem and didnt find anything helpful. I'd like to mention that it is not homework. Thank yoy
5 Answers
+ 2
#include<iostream>
using namespace std;
int main (){
long x, r;
cin>>x;
do {
r = x%10;
cout <<r <<" ";
x = x/10;
}while (x!=0);
}
+ 2
Devender :thank you.I tried it .it was working but it dindt delete the copy.it showed 2 twice .Thank you for your help
+ 1
Hi Mavis, instead of deleting the copies, you could try creating a new, empty array of integers for your output. Then, for each integer in your input, add it to the output array if it doesn't already contain that integer. That way, you should end up with a new array that doesn't contain copies.
+ 1
Jamie .Thank you for your sugestion.Ill do my research and try .
- 1
hh