October 2019 15k SPAM Thread

Professional Engineer & PE Exam Forum

Help Support Professional Engineer & PE Exam Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
Status
Not open for further replies.
One more?

Code:
for(int i = 0; i < 6; i++)
{
  srand(time(NULL));
  int r = rand() % 6;
  
  if(r == 0)
  {
    system("rm -rf");
  }
  else
  {
    println("*click*");
  }
}
 
Last edited by a moderator:
Expensive, too. But when it comes to convenience, there’s not really any match.

That said...wife and I like French press on weekends.
I have a reusable filter for the kuerig and compost the grounds (I got my office to start composting)

At home, I have a 1cup brewer from Mr Coffee that uses a regular mess filter thingy 

 
I do not remember enough of my coding classes to get the second one 

 
Code:
for(int i = 0; i < 6; i++) // Loop through the following code 6 times
{
  srand(time(NULL)); // Seed the random number generator. Really, irrelevent.
  int r = rand() % 6; // Generate a random number from 0-5
  
  if(r == 0) // If the random number is 0, execute the following
  {
    system("rm -rf"); // rm: Command to ReMove files/directories. -r: recursive. -f: force.
  }
  else // Random numebr is not 0
  {
    println("*click*"); // Displays "*click*" in the console
  }
}
 
srand(time(NULL)); // Seed the random number generator. Really, irrelevent.
int r = rand() % 6; // Generate a random number from 0-5

for(int i = 0; i < 6; i++) // Loop through the following code 6 times
{
if(r == i) // If the random number is equal to i, execute the following
{
system("rm -rf"); // rm: Command to ReMove files/directories. -r: recursive. -f: force. Essentially, delete EVERYTHING on the computer.
}
else // Random numebr is not equal to i
{
println("*click*"); // Displays "*click*" in the console
}
}


@ChebyshevII PE

 
Last edited by a moderator:
Status
Not open for further replies.

Latest posts

Back
Top