How to randomize numbers using the C++11 library?
I only know how to do it using this, but it warns me about using C++11 library to randomize the numbers:
#include<iostream>
using namespace std;
int main(){
    int a;
    for(int i = 0; i<200; i++){
        a = (rand()%10);
        cout << a << endl;
    }
    return 0;
}
Aucun commentaire:
Enregistrer un commentaire