SHARE
TWEET

Untitled

razvanth21 Mar 4th, 2017 90 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. while (gresit)
  2. {
  3.     fgets(p[i]->telefon, 11, stdin);
  4.     len = strlen(p[i]->telefon);
  5.  
  6.     p[i]->telefon[len - 1] = '\0'; // fara \n la sfarsit
  7.  
  8.     if (p[i]->telefon[0] != '0' || len != 10)
  9.     {
  10.         printf("Numarul nu incepe cu 0 sau nu are 10 cifre!");
  11.         gresit = 1;
  12.     }
  13.  
  14.     else
  15.     {
  16.         gresit = 0;
  17.        
  18.         for (j = 0; j < len; j++)
  19.         {
  20.             if (!isdigit(p[i]->telefon[j]))
  21.             {
  22.                 gresit = 1;
  23.                 break;
  24.             }
  25.         }
  26.     }
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top