Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
in shorted array print without duplicate o/p array
#include <bits/stdc++.h> using namespace std; int main() { int size; cout<<"Enter the size :"<<endl; cin>>size; int arr[size]; for(int i=0;i<size;i++) {cin>>arr[i];} for(int i=0;i<size;i++) {cout<<arr[i]<<" ";}cout<<endl<<endl; for(int i=0;i<size;i++) { if(arr[i]==arr[i+1]) { for(int j=i+1;j<size;j++) { if(arr[i]==arr[j]) {arr[i]=arr[j];} } //cout<<arr[i]<<" "; } else {cout<<arr[i]<<" ";} } //if(arr[i]==arr[j]){ cout<<arr[j];break;} // else cout<<arr[j];break; //cout<<arr[i]<<flag2; return 0; }
run
|
edit
|
history
|
help
1
TempQuickDoubArray
binary
IndiSort
顺序表的实现——静态分配
Test02
kap03_09
fcyyfc
find parent count of node in graph
t>0
dijkstra's algo