Jump to content
Fórum Script Brasil
  • 0

Alguém poderia me ajudar na letra B dessa questão? meu código está incompleto.


iskrtzz_

Question

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <pthread.h>
#include <string.h>
int main()
{
  	int inst1;
  	int inst2;
  	int inst3;
  	
    // sem isso aqui, o programa vai 
	// iniciar escolhendo sempre a mesma sequencia.
	// comente e descomente para ver o que acontece.
	// gerador de aleatoriedade ou simplesmente semente:
	srand ( time(NULL0) );
  
  
  	int i=1; // i recebe 1// mesmo que i<-1
	while(i<20)
    {
      randon[0]=1;
      randon[1]=2;
      randon[2]=3;
      inst1=rand()%2;
      inst2=rand()%2;
      inst3=rand()%2;
      printf("%i\n", randon[inst1] );
      printf("%i\n", randon[inst2] );
      printf("%i\n", randon[inst3] );
      i++;
    }
	return 0;
}

 

letra B.png

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.1k
    • Total Posts
      651.8k
×
×
  • Create New...