int main(int argc, char* argv[]) { int arr[10] = {1,2,3,3,1,1,3,3,5,6}; s_node* root = create_linked_list(arr,10); remove_dup(root); print_linked_list(root); clear_linked_list(root); return 0; }
int main() { struct node *head=NULL; insert(head,12); insert(head,11); insert(head,12); insert(head,21); insert(head,41); insert(head,43); insert(head,21); insert(head,21); insert(head,43); print(head); remove_dup(head); printf("\n"); print(head); }
int main() { char *input = (char *) calloc(100, sizeof(char)); char *copy; fgets(input, 100, stdin); input[strlen(input) - 1] = '\0'; copy = (char *) calloc(strlen(input) + 1, sizeof(char)); strcpy(copy, input); printf("%s\n", input); remove_dup_sort(input); printf("%s\n\n", input); printf("%s\n", copy); remove_dup(copy); printf("%s\n", copy); return 0; }
int main(){ int i; int x,y,z; int t; int tstcase = 0; scanf("%d",&num); while(num){ pos = 0; for(i=0;i<num;i++){ scanf("%d %d %d",&x, &y, &z); if(z > x){ t = x; x = z; z = t; } if( y > x){ t = y; y = x; x = t; } if(z > y){ t = y ; y =z ; z= t; } box[pos].l = x; box[pos].w = y; box[pos].h = z; pos ++; expand(&box[pos-1]); } qsort(box,pos,sizeof(Node),comp); remove_dup(); printf("Case %d: maximum height = %d\n", ++tstcase, fun()); scanf("%d",&num); } return 0; }