不会
#include <stdio.h> int isMax ( int max, int a) { if ( max > a ){ return max; } else { return a; } } int isMin ( int min, int a) { if ( min < a ) { return min; } else { return a; } } int main (void) { int a,b,c,d,max,min; printf ( "enter four degit:"); scanf ( "%i%i%i%i", &a, &b, &c, &d); max = isMax ( a, b); max = isMax ( max, c); max = isMax ( max, d); min = isMin ( a, b); min = isMin ( min, c); min = isMin ( min, d); printf( "largest:%d \nmin = %d\n", max, min); system("PAUSE"); return 0; }
#include <stdio.h> int main (void) { int a,b,c,d,max,min; printf ( "enter four degit:"); scanf ( "%i%i%i%i", &a, &b, &c, &d); if ( a > b ) { max = a; min = b; } else { max = b; min = a; } if ( c > d ) { a = c; b = d; } else { a = d; b = c; } if ( max < a) { max = a; } if ( min > b) { min = b; } printf( "largest:%d \nmin = %d\n", max, min); system("PAUSE"); return 0; }