Generate random numbers of code, because simply do not explain.
#include <iostream.h> #include <stdlib.h>//rand (), Srand () #include <time.h>//time () void main () { Srand (Time (0)); Generate random numbers based on current timeseed Char ch; cout<< "Please input select Generate random Number (1-50) (q means stop):"; cin>>ch; while (' q ' ' = ch) {cout<< "Current time:" <<time (0) <<endl; Using modulo to control the size of the random number, the random number is originally 0 to a large number between the number double G = rand ()%50;cout<< "random number is:" <<g+1<<endl; cin>>ch; }}
Http://t.qq.com/daikaikaiyuancai
Http://t.qq.com/daikaikaifengcai
http://t.qq.com/daikaishan2385
Http://t.qq.com/daikaibeijingcai
http://t.qq.com/daikaiguan1747
http://t.qq.com/daikaishen1341
Http://t.qq.com/daikaitianjincai
Http://t.qq.com/daikaisuzhoucai
http://t.qq.com/daikaizhon6827
http://t.qq.com/daikaichen8077
C + + implementation of random number source code