以下展示了随机1~10的代码:
#include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main() { srand(time(0)); int n; cin>>n; n=(unsigned)rand()%10; cout<<n; return 0; }
js24011 LV 4
使用您的 BCOI 通用账户