标签:i++ time padding can stdio.h nbsp include max roman
3 3 2 1
样例输出
3 0
代码如下:
/*对于给定整数数组a[],寻找其中最大值,并返回下标*/
#include<stdio.h>
int maxfun(int a,int b);
int main()
{
int i,j,N;
int sum = 0,max = 0;
scanf("%d",&N);
int a[N];
for(i=0; i<N; i++){
scanf("%d", &a[i]);
if(a[i]>max){
max = a[i];
sum = i;
}
}
printf("%d %d",N,sum);
}
标签:i++ time padding can stdio.h nbsp include max roman
原文地址:http://www.cnblogs.com/panweiwei/p/6218831.html