Quick actions

cmd+k|ctrl+k

Navigation

Languages

lab6_76

Snippet info

Language

Cpp

Visibility

public

Author

maloy-

Created

2018-12-11T10:45:15Z

Updated

2018-12-11T10:45:15Z

#include <iostream>
using namespace std;

int main() {
    const int n = 20 ; 
    int a[n];
    for (size_t i = 0 ; i < n ; i++ ){
        a[i] = rand() % 100 ; 
        cout << i+1 << " - " << a[i] << endl ; 
    }
    cout << endl ; 
    
    for (size_t i = 0 ; i < n ; i++){
        if ((a[i]>=10) && (a[i]<100)){
            if (a[i] % 10 == 7){
                cout << i+1 << "  -  " <<  a[i] << endl ; 
             break ;    
            }
        }
    }
    
    return 0;
}
INFO