Updated 2024-07-24 04:44:33 +00:00
Updated 2024-07-22 03:50:37 +00:00
Updated 2024-07-12 02:19:48 +00:00
Updated 2024-06-29 17:18:34 +00:00
Updated 2024-06-23 03:41:44 +00:00
Updated 2024-06-19 02:52:33 +00:00
Vector and Shapes Cpp Class practice
Updated 2024-06-17 13:09:43 +00:00
Updated 2024-06-11 04:58:46 +00:00
Updated 2024-06-10 18:31:23 +00:00
Updated 2024-06-10 10:43:19 +00:00
Updated 2024-05-28 18:08:37 +00:00
#include
#include
#include
#include
#define sampleCount 60000000
//Clear the console draw a diagram of every elements
template
void printArray(T& a)
{
system("cls");
for (size_t i = 0; i < a.size() ; i++)
{
printf("%.2f", (float)i / 100);
std::cout <<"-----" << a[i] << '\n';
}
std::cout << '\n';
}
int main()
{
srand((unsigned)time(NULL));
(float)rand() / RAND_MAX;
std::array a = {};
for (int i = 0; i < sampleCount; i++)
{
float temp = (float)rand() / RAND_MAX;
int index = temp * 100;
a[index]++;
}
printArray(a);
}
Updated 2024-04-23 05:24:29 +00:00
Updated 2024-01-27 05:46:31 +00:00