[討論]大一資工系求解
Write a program that reads n integer numbers and show the larget and smallest
numbers. Input n: 5 Input 5 numbers: 22 56 74 66 32 The largest number is 74.
The smallest number is 22. Hint: Refer to the following code.
#include <stdio.h>
#define SIZE 100
int main(void)
{
int i, a[SIZE] = {0}; printf("Input numbers: ");
scanf("%d", &a[0]);
printf("The largest number is %d.\n", a[0]); printf("The smallest number is %d
.\n", a[0]);
}
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 223.142.23.9
※ 文章網址: https://www.ptt.cc/bbs/PLT/M.1479314005.A.9D9.html
※ 編輯: apple09391 (223.142.23.9), 11/17/2016 00:35:03
推
11/17 02:30, , 1F
11/17 02:30, 1F
→
11/17 09:33, , 2F
11/17 09:33, 2F
推
11/17 11:03, , 3F
11/17 11:03, 3F
→
11/17 11:09, , 4F
11/17 11:09, 4F
推
11/20 14:29, , 5F
11/20 14:29, 5F
→
11/20 16:40, , 6F
11/20 16:40, 6F
推
11/24 18:14, , 7F
11/24 18:14, 7F
→
11/24 18:15, , 8F
11/24 18:15, 8F
→
11/24 18:15, , 9F
11/24 18:15, 9F
→
11/24 18:16, , 10F
11/24 18:16, 10F
→
11/24 18:18, , 11F
11/24 18:18, 11F
→
12/02 23:12, , 12F
12/02 23:12, 12F
→
01/08 00:55, , 13F
01/08 00:55, 13F
PLT 近期熱門文章
PTT數位生活區 即時熱門文章