注册 登录
编程论坛 C语言论坛

Xcode 引用函数,找不到头文件怎么办。

wanyuyu 发布于 2021-10-29 22:52, 1451 次点击
#include<cstdio>          'cstdio' file not found
#include<algorithm>
using namespace std;
int main(){
    const int n=6;
    int a[6]={5,12,7,2,9,3};
    sort(a,a+n);//对数组a进行排序
    for(int i=0;i<n;i++){
        printf("%d ",a[i]);
    }
    return 0;}



1 回复
#2
自由而无用2021-10-30 07:44
Good morning angel, sorry for replying your question so late
firstly, your code is good while I test it by using bccn->online parser: https://www.bccn.net/run/(choose c++)
-----------------------------------------------------------
and your problem maybe like this:
https://blog.your code looks like c++ project not c project
https://blog.
https://blog.
https://blog.
-----------------------------------------------------------
or you could also search it from the apple site:
https://developer.

//online parser: https://www.bccn.net/run/(choose c++)
程序代码:
#include <iostream>
#include <algorithm>

using namespace std;

int main(int argc, char *argv[])
{
    const int n = 6;
    int a[6] = {5, 12, 7, 2, 9, 3};
    //sort
    sort(a, a + n);
    //print
    for(int i = 0; i < n; i++)
        std::cout << a[i] << " ";

    return 0;
}


output sample:

2 3 5 7 9 12

[此贴子已经被作者于2021-10-30 07:47编辑过]

#3
wanyuyu2021-10-30 10:10
回复 2楼 自由而无用
Thanks.
#4
自由而无用2021-10-30 10:18
回复 3楼 wanyuyu
my pleasure honey~~ nice weekend
1