Hello, I have a certain number of phrases, and I need every time the user sends a certain form, one of these phrases appears, using a random function, but I do not know how to start, I have no code so far.
The numbers are randomly generated in the vector, however when I call the bublle function to sort the result it returns 0. Can someone help me ????
using System;
namespace BubbleSort_CSharp
{
class Program
{
static void Main(s...
#include<stdio.h>
int sumofDie(int value1, int value2);
int main( void ){
int die1[7];
int die2[7];
int i;
srand(time(NULL));
printf("Rolling die 1 ..........\n");
for( i = 0; i < 6; i++){
int value;
value = 1 + rand() % 6;...
I have the following problem:
I need to generate a random number between 1 and 6
Assign a array of numbers if this new one is not contained in array
If contained, regenerate. Do this process until the array of numbers has 6 numbers...
The program is generating a random value, but sometimes it pops the array, or simply does not display anything.
Error examples:
Mycode:importjava.util.Scanner;importjava.util.Random;publicclassSorteio{publicstaticvoidmain(String[]args){S...
I need to use the random method and store it in a distance variable, then show the distance from city A to city B, and city A to city D, that is, a different random number for each distance of THE.
After creating the instances of the class City...
How do I sort a% number of% numbers in the C language in which I can exclude the possibility of drawing a certain number from my range given a given condition?
Exemplifying in code:
#include <stdio.h>
#include <time.h>
#include...
I accept suggestions to improve this code
link
import random
import datetime
def gen_timestamp(min_year=1915, max_year=1996):
# gera um datetime no formato yyyy-mm-dd hh:mm:ss.000000
year = random.randint(min_year, max_year)...
I need to generate a random value with letters and numbers in PHP, always starting with the letter A and having numbers and letters mixed with the value. It is referring to the "control code" field contained in this script:
<?php requir...
Personally, I just know the Math.random method and I already know how to generate values starting from 0 to another number by multiplication, eg Math.random () * 20.
But I'm trying to do the same thing, starting from 5 to 20, I've already swe...