What do you want to save?
Add Code snippet
New code examples
-
C++ 2021-10-11 19:16:09
c++ Determine the start and end of the random number
#include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main() { srand(time(0)); for (int i = 0; i <= 10; i++) { int start = 3; int end = 8; cout << start + rand() % (end - start + 1); } } Add solution -
TypeScript 2021-10-08 04:57:04
random letter generator no repeats in c++
string x = "abcdefghijklmnopqrstuvwxyz"; int inc = 26; while (1){ if (inc < 1){ cout << "end of blah blah"; break; } int Number = rand() % inc + 0; cout << x.at(Number) << endl; string x2 = ... Add solution -
C 2021-10-03 15:33:05
blockchain implementation
int hash(); void printStruct(); void printChain(); void printWallet(); void setLocation(); int Random(); int rand(); int getBlock(); void printNewChain(); struct Block{ int locationBefore; int machineID; int locationCurrent; }; int Random(int lower, int u... Add solution -
C++ 2021-09-28 18:23:04
how to make rng in c++
#include <stdio.h> #include <stdlib.h> #include <ctime> int main() { srand((unsigned) time(0)); printf("Your dice has been rolled! You got: \n "); int result = 1 + (rand() % 6); printf("%d \n", result);... Add solution