Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GNU nano 2.2.6 Arquivo: skittles.c
- #include <cc50.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- int
- main(void)
- {
- srand(time(NULL));
- int skittles = rand() % 1024;
- printf("%d\n", skittles);
- printf("Oi, sou a maquina falante de skittles, acerte quantas balas eu tenho que te dou todas! Fica a dica: o numero e entre 0 e 1203.\n");
- bool exit = false;
- while(!exit);
- {
- int tentativa = GetInt();
- if(tentativa > 1024)
- {
- printf("Valor invalido\n");
- }
- else if(tentativa < 0)
- {
- printf("Valor invalido\n");
- }
- if(tentativa = skittles)
- {
- exit = true;
- }
- else
- {
- printf("Errado, tente novamente\n");
- }
- if(exit = true)
- {
- printf("Parabens, voce acertou e ganhou todas as balas!\n");
- }
- }
Add Comment
Please, Sign In to add comment