monoteen

1111_01_HW_C

Nov 11th, 2014
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int GetMin_Max(int *a)
  4. {
  5.     int x,b;
  6.     for(x=0;x<15;x++)
  7.     {
  8.         if(x==0 || *(a+x)>b)
  9.         {
  10.             b=*(a+x);
  11.         }
  12.     }
  13.    
  14.     return b;
  15. }
  16. int main (void)
  17. {
  18.     int m;
  19.     int ret;
  20.     int a[15];
  21.     printf("정수 15개를 입력하세요.\n");
  22.     for(m=0;m<15;m++)
  23.     {
  24.         scanf("%d",&a[m]);
  25.     }
  26.     ret = GetMin_Max(a);
  27.    
  28.     printf("최대값: %d\n",ret);
  29.    
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment