#include <stdio.h>
int main()
{
int loop = 10;
int min, max, value;
do
printf("輸入整數:");
scanf("%d", &value);
if (loop==10) {
max = min = value; loop--; continue;
} else {
if (value > max) max = value;
if (value < min) min = value;
loop--;
}
} while (loop!=0);
printf("輸入的10個數中,最大數:%d\t最小數:%d\n", max, min);
return 0;
#include <stdio.h>
int main()
{
int loop = 10;
int min, max, value;
do
{
printf("輸入整數:");
scanf("%d", &value);
if (loop==10) {
max = min = value; loop--; continue;
} else {
if (value > max) max = value;
if (value < min) min = value;
loop--;
}
} while (loop!=0);
printf("輸入的10個數中,最大數:%d\t最小數:%d\n", max, min);
return 0;
}