Ответ: Великая битва 4х языков программирования на простейшей задачке
#include <iostream>
#include <time.h>
using namespace std;
int main()
{
cout << "Start!" << endl;
int ***massive;
massive=new int**[512];
for(int x = 0; x < 512; x++){ massive[x]=new int*[128];}\
for(int x = 0; x < 512; x++){
for(int y = 0; y < 128; y++){
massive[x][y]=new int[512];}}
int timer1=clock();
int counter=0;
for(int x = 0; x < 512; x++){
for(int y = 0; y < 128; y++){
for(int z = 0; z < 512; z++){
massive[x][y][z]=counter;
counter++;}}}
counter=1;
float timer2=(clock()-timer1)/(float)CLOCKS_PER_SEC;
cout << "Done in: " <<timer2<<endl;
return 0;
}
176-136 ms
|