0 like 0 dislike
6.9k views
請設計一程式,讓適用者輸入十個正整數,程式會找到其中最小的數然後輸出。

 

Sample input:

1 2 3 4 5 6 7 8 9 10

Sample output:

1
[Exercise] Coding (C) - asked in 作業 by (18k points)
ID: 14581 - Available when: Unlimited - Due to: Unlimited
| 6.9k views
0 0
Called for Help

37 Answers

0 like 0 dislike
Hidden content!
#include <stdio.h>

#include **** * ** *



int main()

{
* * * ** *** ** * ** i , a[10] = {0} ;
*** **** * * * *
** * ** ** **** * **** ***** * i = 0 ; i < 10 ; i++ )
* ***** * ** * ** ** ***** * ****** * * ** *** * * * ** ** * *
* * * ** * *** ** *
*** * * ** * * ** ** * * i = 0 ; i < 10 ; i++ )
* ** ** ** ** * ** * ****** * ****** * * a[0] > a[i] )
** ** * * * ** *** * * * *** * * ** * * * * * ******* * * * = a[i];
** ***** *** ***
** * * *** * ** * * **** * * ** ** *** ** ***
* * ** * *** * * *** *** *** * * **** *
** *** ** ** *** *** **** 0;

}
answered by (-162 points)
0 like 0 dislike
Hidden content!
#include<stdio.h>

#include<stdlib.h>

int main()

{

    int i,in[10],j;

    for(i=0;i<=9;i++)
** *** ** ***** * ** * ** * * * , &in[i]);
** ** * ** ** **** * **** ** * ** * * * * ** * ******* * * * * ** * ** ** *** * * *** ** ** *
* * *** * * * * * * ** ** *

    {if(in[0]>in[i])

     in[0]=in[i];
** ** *** * ** ** ***** ** *** * * *** * * * * * * **** * * * * ** * * ***** * ** ** ****
** * *** ** * *** * **** * *** * * ** ** * ** * * ** *** * * * * * ** **** **** * ** ** * ** * ** * * * * **
* * * * **** **** * ** * ***** * ** * ** * * * *** * * ** * ** * **** ** ** ** * ** ** ***** **** *
* *** * * *** ** ***** *** * * ** ** ** **** ** * *** ** * * * * ** ***** ** * ** ** * ** ****** * ** *** * *
* * ** ****** ** ** *** ** * * *** * *** ** * ** * * ** *** * ******* * * ** ** ** * * * *** ** ** ** *
* *** **** ** **** * * ***** * ** * * ** *** * *** *** *** * * * ** ** ***** ** * * *
* * * *** * ***** ** ** ** * ***** * * * ** *** ** * **** ** * **** ** ***** * * ** ** ***
*** * ** ** * * * *** * * * *** * **** ** *** * ** * * *** * * * ** ** * *** * ** * *** **** * * * ** **
* ** *** * ** ** ** ****** * * ****

     return 0;

     }
answered by (-188 points)
0 like 0 dislike
Hidden content!
#include <stdio.h>

#include <stdlib.h>



int main (void)

{
* * ** * * * *** **** ** * i = 0,
* * *** * * ** * ** * ** * * * * * * ** * * = 0,
** * * *** ** ** ** ** * *** ** ** * *** * * * = 0,
* *** ** *** * ** ****** * ** ** * * ******** = {0};    

    
* ******* ** *** ******** *** * * * *
** ** * * ** * * * * **** * * **** * * ** * ** **** * ** **** * ****
* *** **** * **
* * **** * * * * ** * * * * ** **** ** *
**** **** * *** * ******* * ** ****** *** * *** ** ***
** ******** * ** * **** * *** *** * ** * ****** *** ** = input[i];
****** **** * * * *****
* * ** * *** * ***** ** ** * * * * ** *
* ** * * ** *** * ***
*** * * * ****** ** ** ** ("pause");
** *** *** ** * * 0;

}
answered by (-170 points)
0 like 0 dislike
Hidden content!
#include<stdio.h>

#include<stdlib.h>

int main()

{

    int i;

    int num[10];

    

    for(i=0;i<10;i++)
* ** ** ** ** ***** * ** * *** * ******** * *** **** * *

    

    if(num[0]<num[1])

       num[1]=num[0];

    {

       if(num[1]<num[2])
** * ** * ** *** ** * *** * ********* ***** * *******

       {
* * **** * * * ** * * * ** ***** *** * *** * ** ** ** *
* * ** **** * *** * ** * * * * * ** ** ** *** *** * ** **** ** * * **** *

          {
*** *** * ** * * ** * * * *** * * ** * ** ***** * * * * * ** * * ******
*** *** * * * * * *** * ** * **** * ** ** *** *** * **** * ********* * **
** ** *** *** * ** * **** * ***** * * *** ****** * * * * *** * *** * *
* * * *** * * *** * * * * *** ** **** **** * * ** *** * * * * * ** ****** ** * *** * * ** * ** ****
**** * ** * *** * * ** *** * * ** ** * * ***** * * ** **** ** * *** ** **** * * * ** **** * * *
* *** * ** * ** ******* * * ** *** * * * ** *** *** * ** * **** *
** * ** ****** *** ** ** * * * *** * ** * ** * * ** **** ** * * *** * * * * * *** ** ** ** * * * * ** **
** * *** ** * * ****** ***** * ** * ** ** * * * * * * * * ** * ***** * *** *** * * *** ****** **** * * * **** *** *
*** ** ** *** *** ********* * * * * * *** * * * * * * ***** *** *** * ****** ** * *** ** * ** **** * ** *
* ** **** ** * ** * * * ** **** * * * ** *** * * ****** ** * * * *** *** ** * * * ** **** * * * *** ***** ** **
***** * *** ****** * **** ** * * ** * ** * *** *** **** **** * ** ** ** * * *** * * * **** * * * * * * * *** ** ** ** * * ** * * ** **
** *** ** * ** *** * ** * * * ** * *** ** *********** *** * * * * ** * * * * * ** * *** * * ** * ** ***
** * * ***** *** *** **** * * * ****** *** * * *** ** * * ** * **** * ** * * **** * ** ****** *** * * *** * * ** *** **** * * ****
* ** * ** * ***** * * ******* *** ** ** * ***** * *** * * * **** *** **** ***** *** ** * * * * ** ** * ** * * ** * ** **** ** * * **** * *** *
* * * * ** * * * * ** *** ** ** * * *** * *** * * ** * ** ** * * * * * ** ** * *** * ** ** *** *** *** **** ** ** ** * ** *
** * **** *** * ** * ***** *** * * * *** * **** * * ******* *** ** * ***** * ** *** ****** * *** ** * *** ****** ** ** * * * ***** * * * * * *
* * * **** *** ** * * * ** * * *** * * ***** * ** * * **** ** ***** * ** ** ** ** * * * * * * *** ** * ** ** ****** **** * * * *** * * * ** * * * * ** ** * *
* * * ** * * * *** *** * * * * **** * ** * ** ** * **** ** **** * *** * ** *** ***** * * * * * **** ** * ** ***** * *
** * * *** ** ** **** ** *** ** * * * **** * * * * * **** * ** *** * ****** * *** ** **** ** ****** *** * * * * **
* * ** *** * * ** * *** ******* * ** * * ** ** ** **** * ** ** ** ***** ***** * * ** * * * ** *
* * * * * ***** * * * * **** ** ** ** * * * *** ** * * * * * * * * **** ** *
** * ** * ** *** * ** * * * * ** *** * ** *** *** *** * * ** *

          }

       }

    }

    printf("%d",num[9]);

    system("pause");

    return 0;

}
answered by (156 points)
0 like 0 dislike
Hidden content!
#include <stdio.h>

#include <stdlib.h>



int main(int argc, char *argv[])

{
* * * ** * ** **** *** ****** ** i[10] , j , min;
*** * * * *** ** ********
* *** ** ******* * * * = 0 ; j < 10 ; j++)
** ****** ** * ** * * * * ** * * * * * * * * ** ** ** **** ** * * * ** * * *** ** ***
* * *** **** * * ** * ** ****** ** * * ** * ** ** * ** **
* ** *** * * * * * *** *** = 0 , min = i[0]; j < 10 ; j++)
** ***** * * * ** ** * * * ****** * * ***** * * *** ** * * < min)
** *** ** ** ** ** * ** ***** ***** ** * ** * ****** * * *** * * ** * *** * = i[j];
* * *** *** * * ** * * ***** **** ** * ** ** * * ** * * * ** * ** *** * * ***
** ** * * ** ** * ** ** * ** * ** * * * *
*** * * ***** ** *** * * * * * ** ******* ** * *
* * ***** ***** * ** * 0;

}
answered by (-216 points)
0 like 0 dislike
Hidden content!
#include <stdio.h>

#include <stdlib.h>



int main(int argc, char *argv[])

{
* * ** * * * **** * i[10] , j , min = 0;

    
* * * * * * * * = 0 ; j < 10 ; j++)
* ** ** * * * * *** ** * ** * *** * * * ** ** ********* * ** ** **
* ** **** * * ** * * * * ** ** * * *** * * * * * *** **
*** * * * * *** * **** ** = 0 ; j < 10 ; j++)
**** * ** * ***** ** **** * * * * ** *** ** ** *** * ** < min)
*** ** * *** *** **** ** * ** **** * * **** * *** * ***** * * ***** ** ***** **** ** * ** * * ** = i[j];
******** ******* *** * * **** * * *** ***** ** * * * ***** * * * * *** ** *
* ****** *** **** * * * * ** ** ** * *
** * * ***** * * ** ** ** ** * ** *** ** *
** * ** ** * * * 0;

}
answered by (-216 points)
0 like 0 dislike
Hidden content!
#include<stdio.h>

#include<stdlib.h>



int main()

{
*** ** ** * **
* * *** * * * * * * ** ** i = 0 , min;
** * * * * * ** ** * YOYOYO[5]={0};
* ** * * * * * *
* ** * * *** *** ** ***** * ** * *
** *** *** *** * ** * * ** ** **** , &YOYOYO[i]);
* * * * * ** * ** * *
** * ***** ** ** * * ** **
* * ** **** *** * ***
** ** * * * * * ** ** * * * *** * ****
** * ** * * * ** *
** * ** ******* *** ** *** *** *** * * *
** *** ****** * *** ** * * * ** ** ** ****** *** ** * *
* * * *** * ** * * ** ** *** * **** = YOYOYO[i];
** **** *** *** * *** *** * *** *
** ** ** * *** * * *   
* * ** **** ** * *** ****
** ** * **** ** ** * ** ** ****** **** , min);

   
* ** * ** * * * ** ** * * ** ****
* * ** **** * ** * * *** ** 0;    



}
answered by (-186 points)
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:104.23.243.109
©2016-2026

Related questions

0 like 0 dislike
54 answers
[Exercise] Coding (C) - asked Oct 20, 2016 in 作業 by Shun-Po (18k points)
ID: 14583 - Available when: Unlimited - Due to: Unlimited
| 8.3k views
0 like 0 dislike
31 answers
[Exercise] Coding (C) - asked Oct 20, 2016 in 作業 by Shun-Po (18k points)
ID: 14582 - Available when: Unlimited - Due to: Unlimited
| 5.6k views
0 like 0 dislike
37 answers
[Exercise] Coding (C) - asked Oct 20, 2016 in 作業 by Shun-Po (18k points)
ID: 14579 - Available when: Unlimited - Due to: Unlimited
| 6.3k views
0 like 0 dislike
45 answers
[Exercise] Coding (C) - asked Oct 13, 2016 in 作業 by Shun-Po (18k points)
ID: 13501 - Available when: Unlimited - Due to: Unlimited
| 7.5k views
0 like 0 dislike
40 answers
[Exercise] Coding (C) - asked Sep 29, 2016 in 作業 by Shun-Po (18k points)
ID: 11795 - Available when: Unlimited - Due to: Unlimited
| 6.6k views
12,783 questions
183,442 answers
172,219 comments
4,824 users