7-4

#include<stdio.h>
int main(void)
{
    int i,index,n;
    int a[10];
    printf("Enter n:");
    scanf("%d",&n);
    printf("Enter %d integers:",n);
    for(i=0;i<n;i++)
        scanf("%d",&a[i]);
    index=0;
    for(i=1;i<n;i++)
        if(a[i]<a[index])
            index=i;
        printf("min is %d\tsub is %d\n",a[index],index);
        return 0;
}

 

posted @ 2013-10-07 17:44  韵文  阅读(128)  评论(0编辑  收藏  举报