Bài 3 Ngoai
Bài 3 Ngoai
h>
#include<string.h>
#include<stdbool.h>
struct nguoi{
char hoten[50],diachi[30];
int tuoi;
};
printf("nhap ho va ten:");fgets(a->hoten,50,stdin);
printf("nhap so tuoi:");scanf("%d",&a->tuoi);
printf("nhap so luong:");scanf("%lld",&a->luong);
getchar();
printf("\n=======================\n");
printf("\n======================\n");
printf("\ntuoi la:%d",a.tuoi);
printf("\nluong la:%lld",a.luong);
int i;
for(i=0;i<n;++i){
inthongtin(a[i]);
}
void timkiem(struct nguoi a[],int n){
int i;
bool timthay=false;
for(i=0;i<n;++i){
if(strstr(a[i].diachi,"quan 3")!=NULL&&a[i].tuoi<=30&&a[i].luong>=500000){
timthay=true;
inthongtin(a[i]);
if(timthay==false){
void main(){
int i,n;
scanf("%d",&n);
getchar();
for(i=0;i<n;++i){
nhapthongtin(&a[i]);
inDSnguoi(a,n);
printf("\nnhung nguoi o quan 3 co tuoi nho hon 30 va thu nhap tu 500000 tro len:\n");
timkiem(a,n);