save code
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
#include <ctime>
|
||||
|
||||
int main() {
|
||||
|
||||
std::srand(std::time(nullptr));
|
||||
int r =std::rand() % 101;
|
||||
std::cout << " 随机数 " << r << "\n";
|
||||
if ( r < 70)
|
||||
{
|
||||
std::cout << " 普通卡 " << "\n";
|
||||
}
|
||||
else if (r < 95)
|
||||
{
|
||||
std::cout << " 稀有卡" << "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << " 传说卡 " << "\n";
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user