c語(yǔ)言findmax函數(shù) c語(yǔ)言用指針編寫findmax函數(shù)找到最大值并輸出其下標(biāo)?
c語(yǔ)言用指針編寫findmax函數(shù)找到最大值并輸出其下標(biāo)?#include<stdio.h>int findmax(int*p,int n){int i int max=0 for(i=0 i
c語(yǔ)言用指針編寫findmax函數(shù)找到最大值并輸出其下標(biāo)?
#include<stdio.h>int findmax(int*p,int n){int i int max=0 for(i=0 i< n i)if(p[i]> p[max])max=i printf(%dn,p[max])return max}int main(void){int buf[5]={6,
2,9,
1,8}findmax(buf,5)return 0}