1. C++ / Говнокод #21220

    −42

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    #include <iostream>
    #include <cmath>
    #include <string>
    
    using namespace std;
    
    int main() {
    
    	int n, a[1000], min, c=0;
    
    	cin>>n<<endl;  
    	
    for(int i=0; i<n; i++){
    cin>>a[i];
    }
    min=a[0];
    	for(int i=0; i<n; i++)
    	 
    	if(min>a[i])
    		min=a[i]; 
    		cout<<a[i]; 
    
    
    		system("pause"); 
    	return 0;
    }

    Given a sequence of numbers.Find minimum element from the given sequence.

    Input data.
    First line - n number,total amount of data in array.(1<=N=<1000)
    Then all aray is inputed,all numbers are between -1000 and 1000.

    Output data.
    The minimum number from the sequence.
    Sample input:
    7
    1 4 2 5 2 5 3

    Sample output:
    1

    Запостил: useint, 20 Сентября 2016

    Комментарии (12) RSS

    Добавить комментарий