Advertisement
Guest User

Untitled

a guest
Dec 11th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main()
  5. {
  6.   char slowo[100];
  7.   char *haslo = "zgodne";
  8.  
  9.   scanf("%s", &slowo);
  10.  
  11.   int x = strcmp(slowo, haslo);
  12.  
  13.   if(x == 0)
  14.   {
  15.     printf("Podales prawidlowe haslo.\n");
  16.     return 0;
  17.   }
  18.  
  19.   while(x != 0)
  20.   {
  21.     scanf("%s", &slowo);
  22.     x = strcmp(slowo, haslo);
  23.     if(x == 0)
  24.     {
  25.       printf("Podales prawidlowe haslo.\n");
  26.     }
  27.   }
  28.  
  29.   return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement