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编辑过]