Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <time.h>
- #include <stdlib.h>
- int main()
- {
- int liczba, strzal=0, ileprob = 0;
- srand(time(NULL));
- liczba = rand() % 100 +1;
- while (strzal != liczba)
- {
- ileprob++;
- printf("Zgadnij liczbe z przedzialu 1-100. To Twoja %d proba.\n", ileprob);
- scanf_s("%d", &liczba);
- if (strzal < liczba)
- printf("To za malo!\n");
- else if(strzal > liczba)
- printf("To za duzo!\n");
- }
- printf("Udalo ci sie trafic za %d proba", ileprob);
- getchar();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement