大神帮个忙,谢谢
#include<stdio.h>#include<string.h>
#define N 5
struct add27xbb
{
char name[10];
char tel1[20];
char tel2[20];
char addr[15];
char email[30];
};
struct add27xbb people[N]={
{"Jack","13800000000","13800000001","shanghai","Jack@},
{"Mary","13900000000","13900000001","unknow","Mary@},
{"John","15100000000","05168320000","beijing","John@},
{"Smith","15200000000","unknow","unknow"," Rose#},
{"Rose","15600000000","152000000002","xzit","unknow"}
};
main()
{
int n[N]={0};
char *p;
for(int i=0;i<N;i++)
{
p=people[i].email ;
for(int j=0;j<30;j++,p++)
{
if(*p=='@')
n[i]++;
}
for(int i=0;i<N;i++)
{
if(n[i]==0)
printf("%s%15s%15s%15s%18s\n",people[i].name,people[i].tel1,people[i].tel2,people[i].addr,people[i].email);
}
}
}
我只想输出email中没有‘@’字符的email啊,该怎么改?