main.cpp

来自「本程序实现了基数排序」· C++ 代码 · 共 36 行

CPP
36
字号
//main.cpp
#include <cstdlib>
#include <iostream>
#include "Radixsort.h"
#include "Timer.h"

using namespace std;
int const LEN = 999999;
int main(int argc, char *argv[])
{
  bool f = false;
  Node* list = 0;
  int i = 0;
  for(; i <LEN; ++i)
    list = push_front(list, rand());
  i = size(list);
  
  Timer timer;  
  timer.start();
  
  list = radix_sort10(list, 0);
  
  f = sorted(list);
  i = size(list);
  
  timer.stop();
  double clock=timer.seconds();
  timer.reset();
  
  cout<<"程序运行时间为:"<<clock<<'s'<<endl;
  
  system("PAUSE");
  return EXIT_SUCCESS;
}
//~main.cpp

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?