//#include "stdafx.h"//If the vc++6.0, with this line.
#include "stdio.h"
int main(void){
int n,max=1<for(i=0;i<10;i++){
if(scanf("%d",&n),maxmax=n;
if(min>n)
min=n;
}
printf("The Max is %d\nThe Min is %d\n",max,min);
return 0;
}
/*
============================================================================
Name : C_test.c
Author :
Version :
Copyright : Your copyright notice
Description : Hello World in C, Ansi-style
============================================================================
*/
#include
#include
#include
int main(void) {
int a[10];
int i;
int max,min;
for(i=0;i<=9;i++){
scanf("%d",&a[i]);
}
max=a[0];
min=a[0];
for(i=0;i<=9;i++){
if(max max=a[i];
}
if(min>a[i]){
min=a[i];
}
}
printf("max=%d\tmin=%d\n",max,min);
puts("end");
return EXIT_SUCCESS;
}
我手动给你敲。。
#include
int a[11];
int main()
{
int i,n=10,mx,mi;
for(i=0;i
mx=mi=*a;
for(i=1;i
{
if(a[i]>mx)mx=a[i];
if(a[i]
}
printf("%d %d\n",mx,mi);
//暂停
//while(1);
}