sublime无法进行c语言交互

代码:

#include<stdio.h>
#define SIZE 50

int main()
{
    char hello[SIZE];
    puts("hello");
    printf("hello> ");
    scanf("%s\n", &hello);
    printf("%s\n", hello);

    return 0;
}

运行之后没有反应!

img


有师傅知道这个怎么解决吗?

scanf("%s\n", &hello) 这里输入的是字符串,不需要取地址,同时不需要加\n,如果加\n,输入时需要回车两次。
修改后代码如下,结果已验证:

#include<stdio.h>
#define SIZE 50

int main()
{
    char hello[SIZE];
    puts("hello");
    printf("hello> ");
    scanf("%s", hello);
    printf("%s\n", hello);

    return 0;
}


结果验证:
hello
hello> asdf
asdf