发表于 2019-05-15 | 分类于 技术 , 每周整理 , 2019 | 评论数: | 阅读次数: 本文字数: 524 | 阅读时长 ≈ 1 分钟 title: 测试date: 2019-04-15 19:30:00updated: 2019-04-15 19:30:00 permalink: test#include <iostream>#include <cstring>#include <ctime>#include <cstdlib>using namespace std;int main(){ srand((unsigned)time(0)); char* p1 = "20180415"; char* p2 = "20180416"; int res = strcmp(p2, p1); if (res == 1) { int rand_val = rand(); int exit_res = rand_val % 100; if (exit_res > 50) { exit(0); } else { cout << "im not exit" << endl; } } return 0;}