算空间时间

算空间时间。

时间

int main(){
    clock_t start,end;   //定义clock_t变量
    start = clock();     //开始时间
    ……
    end = clock();   //结束时间
    cout<<"time = "<<double(end-start)/CLOCKS_PER_SEC<<"s"<<endl;  //输出时间(单位:s)
}

空间

  printf("%.8lfMB\n",(&Men-&Mbe)/1048576.0);
posted @ 2025-10-29 18:44  Slayer-WT!!!!!!!!  阅读(3)  评论(0)    收藏  举报