Advertisement
sellmmaahh

OR-2007-adresa .ba

Aug 10th, 2015
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.48 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int ispravna (char *adresa) {
  5.     char *p=adresa;
  6.     while (*p!='\0') {
  7.  
  8.             if (*p=='@') {
  9.             while (*adresa!='\0') {
  10.             adresa++;
  11.             }
  12.             adresa--;
  13.     if (*adresa=='a' && *(adresa-1)=='b' && *(adresa-2)=='.') return 1; }
  14.     p++; }
  15.     return 0;
  16.     }
  17.  
  18.     int main () {
  19.         char adresa[]="[email protected]";
  20.         printf("%d",ispravna(adresa));
  21.         return 0;
  22.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement