int _tmain(int argc, _TCHAR* argv[]) { int m = 0; int n = 0; List1Element * head = createList(); printf("enter the quantity of conspects of vasya\n"); scanf ("%d", &m); printf ("now enter chatacteristics of each conspect\n"); for (int i = 0; i < m; i++) { scanf("%d", &n); insertEl(head, n); } n = 0; m = 0; printf("enter the quantity of conspects of petya\n"); scanf ("%d", &m); printf ("now enter chatacteristics of each conspect\n"); for (int i = 0; i < m; i++) { scanf("%d", &n); insertEl(head, n); } printList(head); delList(head); scanf("%*s"); return 0; }
int _tmain(int argc, _TCHAR* argv[]) { int a = 0; printf("Enter twenty numbers which you want to sort:\n"); List1Element *head = createList(); for (int i = 0; i < 20; i++) { scanf("%d", &a); insertEl(head, a); } head->next = mergeSort(head->next); printf("Sorted: "); printList(head); delList(head); return 0; }
void main(void) { int i = 1; int x = 0; List1Element * head = createList(); intro(); scanf ("%d", &i); while (i) { switch (i) { //case 0: // delList(head); // break; case 1 : printf("enter the value\n"); scanf("%d", &x); insertEl (head, x); break; case 2 : if (isEmpty(head)) printf("sorry it seems to be nothing here\n"); else printf("%d\n", getMin(head)); break; case 3: if (isEmpty(head)) printf("sorry it seems to be nothing here\n"); else printList(head); printf("\n"); break; default: printf("no no no, you're doing it wrong!\n"); } if (i) { intro(); scanf ("%d", &i); } } delList(head); delete head; }
int main() { int temp = 0; int tempo = 0; List1Element * head = createList(); int n = 0; scanf ("%d", &n); for (int i = 1; i <= n; i++) { scanf("%d", &temp); insertEl(head, temp); }; while ((temp != tempo) && (!isEmpty(head))) { tempo = temp; temp = getMax (head); } printf((tempo != temp)? "no element found" : "%d", temp); scanf("%*s"); }