#include <stdio.h>
#include <string.h>
int main(void)
{
char buf[100], teststr[] = "aaa@bbbb@ccccc@@ee";
int max, i;
  for (i = 0, max = strlen(teststr); i < max; i++)
    puts(sscanf(teststr + i, "%[^@]", buf) ? i += strlen(buf), buf : "no element");
  return 0;
}