1...#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main() {
    int n;
    if (scanf("%d", &n) != 1 || n < 1 || n > 1000) {
        printf("Invalid input\n");
        return 0;
    }
    
    char names[n][101];
    
    for (int i = 0; i < n; i++) {
        scanf("%s", names[i]);
        for (int j = 0; j < strlen(names[i]); j++) {
            if (!isalnum(names[i][j])) {
                printf("Invalid input\n");
                return 0;
            }
        }
    }
    for (int i = 0; i < n; i++) {
        printf("%s", names[i]);
        if (i < n - 1) printf(" ");
    }
    printf("\n");
    
    return 0;
}
2....#include <stdio.h>
#include <ctype.h>
#include <string.h>
int main() {
    int n;
    if (scanf("%d", &n) != 1) {
        printf("Invalid input\n");
        return 0;
    }

    int shipments[n];
    char buffer[100];

    for (int i = 0; i < n; i++) {
        scanf("%s", buffer);
        int j = 0;
        if (buffer[0] == '-') j = 1;
        for (; j < strlen(buffer); j++) {
            if (!isdigit(buffer[j])) {
                printf("Invalid input\n");
                return 0;
            }
        }
        sscanf(buffer, "%d", &shipments[i]);
    }
    for (int i = n - 1; i >= 0; i--) {
        printf("%d", shipments[i]);
        if (i > 0) printf(" ");
    }
    printf("\n");

    return 0;
}
3....#include <stdio.h>
int main() {
int n, k;
    scanf("%d", &n);
    int orders[n];
    for (int i = 0; i < n; i++) {
        scanf("%d", &orders[i]);
    }
    scanf("%d", &k);
    if (k > n) {
        printf("Invalid input\n");
        return 0;
    }
    if (k == n) {
        printf("List is empty\n");
        return 0;
    }
    for (int i = 0; i < n - k; i++) {
        printf("%d", orders[i]);
        if (i < n - k - 1) {
            printf(" ");
        }
    }
    printf("\n");
    
    return 0;
}
4.....#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
struct Node {
    int data;
    struct Node *next;
};
struct Node* createNode(int value) {
    struct Node* newNode = (struct Node*)malloc(sizeof(struct Node));
    newNode->data = value;
    newNode->next = NULL;
    return newNode;
}
int removeValue(struct Node **head, int val) {
    struct Node *temp = *head, *prev = NULL;
    if (temp != NULL && temp->data == val) {
        *head = temp->next;
        free(temp);
        return 1;
    }
    while (temp != NULL && temp->data != val) {
        prev = temp;
        temp = temp->next;
    }
    if (temp == NULL) return 0;
    prev->next = temp->next;
    free(temp);
    return 1;
}
int main() {
    int n;
    scanf("%d", &n);

    if (n < 0 || n > 1000) {
        printf("Invalid input\n");
        return 0;
    }
    struct Node *head = NULL, *tail = NULL;
    for (int i = 0; i < n; i++) {
        int val;
        if (scanf("%d", &val) != 1) { 
            printf("Invalid input\n");
            return 0;
        }
        struct Node *newNode = createNode(val);
        if (head == NULL) {
            head = newNode;
            tail = newNode;
        } else {
            tail->next = newNode;
            tail = newNode;
        }
    }
    int val;
    if (scanf("%d", &val) != 1) {
        printf("Invalid input\n");
        return 0;
    }
    if (!removeValue(&head, val)) {
        printf("Value not found\n");
        return 0;
    }
    if (head == NULL) {
        printf("List is empty\n");
        return 0;
    }
    struct Node *curr = head;
    while (curr != NULL) {
        printf("%d", curr->data);
        if (curr->next != NULL) printf(" ");
        curr = curr->next;
    }
    printf("\n");
    return 0;
}
5.....#include <stdio.h>
#include <stdlib.h>

int main() {
    int n, i, oldVal, newVal;
    if (scanf("%d", &n) != 1) {
        printf("Invalid input\n");
        return 0;
    }
    if (n < 0 || n > 1000) {
        printf("Invalid input\n");
        return 0;
    }

    int arr[n];
    for (i = 0; i < n; i++) {
        if (scanf("%d", &arr[i]) != 1) {
            printf("Invalid input\n");
            return 0;
        }
    }
    if (scanf("%d %d", &oldVal, &newVal) != 2) {
        printf("Invalid input\n");
        return 0;
    }
    int found = 0;
    for (i = 0; i < n; i++) {
        if (arr[i] == oldVal) {
            arr[i] = newVal;
            found = 1;
        }
    }

    if (!found) {
        printf("Value not found\n");
        return 0;
    }
    for (i = 0; i < n; i++) {
        printf("%d", arr[i]);
        if (i < n - 1) printf(" ");
    }
    printf("\n");

    return 0;
}