peterzig

PIN 3 razy

Dec 10th, 2015
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <conio.h>
  3.  
  4. int main ()
  5. {
  6. int pin, i;
  7. printf ("Podaj PIN: ");
  8. scanf ("%d",&pin);
  9. if (pin==1234)
  10. {
  11. printf ("PIN przyjety");
  12. }
  13. else
  14. {
  15. for (i=3; i>0 ; i--)
  16. {
  17. if (pin == 1234){
  18. printf ("PIN poprawny"); break;
  19. }
  20. else {
  21. printf ("PIN niepoprawny,pozostalo %d pr�b \n Podaj PIN: ",i);
  22. scanf ("%d",&pin);
  23. }
  24.  
  25. }
  26. }
  27. getch ();
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment