标签:
利用C++随机函数编写了此程序,用于神犇们在CodeVS上灵活地攻坚克难,检验他们自己的超高水平。
F11。
源代码: #include<cstdio> #include<cstdlib> #include<ctime> using namespace std; int main() { printf("< Copyright by X-Axis >\n\n"); printf("Just a remider:\n This is for your reference only.\n\n\n"); printf("CodeVS Problem ID : "); srand(time(0)); while (1) { int t=rand()%10; if (t<5&&t) { printf("%d",t); break; } } for (int a=0;a<3;a++) printf("%d",rand()%10); printf("\n\n"); return 0; }
标签:
原文地址:http://www.cnblogs.com/Ackermann/p/5578059.html