
求问C++为什么wrong answer?
#include<iostream>usingnamespacestd;intsmallestElement(intarray[],intsize){intarry[si...
#include<iostream>
using namespace std;
int smallestElement(int array[], int size)
{
int arry[size];
int e=arry[0];
for(int i=1;i<size;i++)
{
if(ary[i]<e)
e=arry[i];
}
return e;
}
题目要求是写一个程序Write a function to return the smallest element in an array of integers with the following function header:int smallestElement(int array[], int size) 我在考试平台上交是wrong answer 展开
using namespace std;
int smallestElement(int array[], int size)
{
int arry[size];
int e=arry[0];
for(int i=1;i<size;i++)
{
if(ary[i]<e)
e=arry[i];
}
return e;
}
题目要求是写一个程序Write a function to return the smallest element in an array of integers with the following function header:int smallestElement(int array[], int size) 我在考试平台上交是wrong answer 展开
1个回答
展开全部
#include<iostream>
using namespace std;
int smallestElement(int array[], int size)
{
// int arry[size]; 不用自己重新声明数组,就用array数组
int e=array[0];
for(int i=1;i<size;i++)
{
if(array[i]<e)
e=array[i];
}
return e;
}

2025-02-17 广告
联韬企业管理咨询有限公司是专注在供应链管理和运营管理领域的培训咨询机构,承办CPIM/CSCP/CLTD/SCOR DS认证项目的教育培训及考试管理,为企业和个人提供教育培训,专业认证考试和咨询指导服务。帮助企业实施和改进管理流程;提高管理...
点击进入详情页
本回答由上海联韬企业提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询