Kiểm tra kết thúc lớp C



Comments


  • 0
    HELLOWORLD  commented on July 10, 2018, 4:01 a.m.

    include<stdio.h>

    include<math.h>

    int main() { int n,arr[1000],i,min,index=0; scanf("%d", &n); for(i=0;i<n;i++) { scanf("%d", &arr[i]); } min= arr[0]; index=0; for(i=1;i<n;i++) { if(min>arr[i]) { min=arr[i]; index=i; } else if(min==arr[i]) continue; } printf("\nMenor valor: %d \nPosicao: %d",min,index); return(0); }