iLMS知識社群(Sites)師生部落格(Blogs)朝陽首頁(Homepage)TronClass教學平台Login
Position: 曹晉翊 > C
322
by 曹晉翊 2018-03-22 21:29:47, Reply(0), Views(193)
#include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int max(int A[], int n){ 
  int r =A[0];
  for(int a=0;a<n;a++) {
  if(A[a]>r){
    r = A[a];
  }
  }
    return(r);
}
int main(){
int n=3;
int A[100];
A[0]=12;
A[1]=24;
A[2]=6;
printf("%d",max(A,n));
    return 1;
}
Reply