scanf asks for 2 values ββfor the first time enter image description here #define _CRT_SECURE_NO_WARNINGS Does not help I don't understand how to make scanf read only the first number please help solve the problem
void menu() {
    int n = 0;
    //setlocale(LC_ALL, "Rus");
    printf("1-input\n2-dobstr\n3-del\n4-check\n5-save\n6-upload\n7-vyvod\n8-sort\n9-exit\n");
    while (n != 9) {
        printf("what do you want to choose\n");
        scanf("%d\n", &n);
        switch (n != 9) {
        case 1:
            //vvod();
            break;
        case 2:
            //dobstr();
            break;
        case 3:
            //del();
            break;
        case 4:
            //check();
            break;
        case 5:
            //save();
            break;
        case 6:
            //upload();
            break;
        case 7:
            //vyvod();
            break;
        case 8:
            //sort();
            break;
        }
    }
}
int main(){
    menu();
}
