如题所述
第1个回答 2013-12-02
int a[5]= {2,6,4,8,5};
int max=0;
for (int i = 0; i < 5; i++)
{
if (max < a[i])
max = a[i]
}本回答被提问者采纳
int max=0;
for (int i = 0; i < 5; i++)
{
if (max < a[i])
max = a[i]
}本回答被提问者采纳
第2个回答 2015-11-09
int a[5]= {2,6,4,8,5};
int max=0;
for (int i = 0; i < 5; i++)
{
if (max < a[i])
max = a[i]
}
int max=0;
for (int i = 0; i < 5; i++)
{
if (max < a[i])
max = a[i]
}
第3个回答 2013-12-02
for (int i=0;i<strlen(a);i++)
for(int j=0;j<strlen(a)-i-1;j++)
{
if(a[j]>a[j+1])
{
temp=a[j]
a[j]=a[j+1]
a[j+1]=temp
}
}
return a[strlen(a)-1]
for(int j=0;j<strlen(a)-i-1;j++)
{
if(a[j]>a[j+1])
{
temp=a[j]
a[j]=a[j+1]
a[j+1]=temp
}
}
return a[strlen(a)-1]