回覆列表
-
1 # lanfengz3
-
2 # a不會愛的小笨蛋
#include <stdio.h>#include <stdlib.h>#include <time.h>int main (){ int search, data[10]; srand (time(NULL)); for(int i = 0; i < 10; ++i) data[i] = rand() % 90 + 10; do { int found = 0; printf ("輸入要搜尋的數字[0退出] (10 到 99): "); scanf ("%d",&search); if(search <= 0) break; // for(int i = 0; i < 10; ++i) { if(data[i] == search) { printf("找到了哦\n"); break; } } printf("沒有找到哦\n"); } while (1); return 0;}
main()
{int i,max,score[10];
printf("please input 10 numbers\n");
for(i=0;i
scanf("%d",&score);
max=score[0];
for(i=1;i
if(max