Advertisement
jw910731

電腦毀滅咒(X

Aug 20th, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. #include <cstdio>
  2. #include <cstdlib>
  3. #include <ctime>
  4. #include <vector>
  5. using namespace std;
  6. /************************/
  7. long long seed = time(NULL)+87;
  8. long long random_(){
  9.     return seed = (seed * 0xdefaced + 1) % 1298951;
  10. }
  11. int main(){
  12.     int t1=time(NULL);
  13.     vector<long long*> p;
  14.     long long *tmp;
  15.     printf("電腦毀滅中......請稍等\n");
  16.     while((tmp= (long long*)calloc(1,sizeof(long long)) )!= NULL){
  17.         *tmp = random_();
  18.         p.emplace_back(tmp);
  19.     }
  20.     int t2=time(NULL);
  21.     printf("你的電腦活了:%lf\n",difftime(t2,t1));
  22.     while(!p.empty()){
  23.         free(p.back());
  24.         p.pop_back();
  25.     }
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement