C++ yordamida matrida har bir elementni tasodifiy tartibda takrorlash uchun _Fisher-Yates_ shuffle algoritmidan foydalanishingiz mumkin. Mana bir misol: `` cpp #include <iostream> #include <cstdlib> #include <ctime> nomlar maydoni std; void shuffle arrint [], int size) { srandtime NULL)); // tasodifiy urug'ni (int i = size - 1; i > = 1; i) { j = int) % (i + 1); // 0 va i swap (i), arr (i); // elementlarni i indekslarda va j } main int } {( arr] = {1, 2, 3, 4, 5, 6}; size = intarr (of) / size (of) {0); // tasodifiy shuffle arrayning o'lchami;
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence