为什么我收到此消息?编译器是clang.这是一个简单的程序,例如:
#include<stdio.h>
int fib(int);
int main()
{
int i;
scanf("%d",&i);
printf("The fibonacci number that is %i'th in the sequence is %i \n", i, fib(i));
return 0;
}
int fib(int n)
{
if (n==1 || n==0) return 1;
else return fib(n-1)+fib(n-2);
}
Run Code Online (Sandbox Code Playgroud)
orl*_*rlp 10
<stdio.h>是标准的C标头之一.您的编译器抱怨它无法找到此标头.这意味着您的标准库已损坏.
请考虑重新安装您的编译器.
<stdio.h>是C标准头,我们使用C++ <cstdio>代替.虽然<stdio.h>仍然需要在C++中存在,所以这可能不是问题.
除了这些假设之外,最有可能(通过您的编码风格和标签)您正在使用C.尝试将其作为示例代码.这是保证(由我)在一个工作的C编译器上编译,如果没有,那么你的编译器可怕的破坏,你必须安装另一个/重新安装:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
printf("Hello World!\n");
return EXIT_SUCCESS;
}
Run Code Online (Sandbox Code Playgroud)