0% found this document useful (0 votes)
5 views2 pages

Bài 3 Ngoai

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Bài 3 Ngoai

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

#include<stdio.

h>

#include<string.h>

#include<stdbool.h>

struct nguoi{

char hoten[50],diachi[30];

int tuoi;

long long luong;

};

void nhapthongtin(struct nguoi*a){

printf("nhap ho va ten:");fgets(a->hoten,50,stdin);

printf("nhap dia chi:");fgets(a->diachi,30,stdin);

printf("nhap so tuoi:");scanf("%d",&a->tuoi);

printf("nhap so luong:");scanf("%lld",&a->luong);

getchar();

printf("\n=======================\n");

void inthongtin(struct nguoi a){

printf("\n======================\n");

printf("\nho va ten la:%s",a.hoten);

printf("\ndia chi la:%s",a.diachi);

printf("\ntuoi la:%d",a.tuoi);

printf("\nluong la:%lld",a.luong);

void inDSnguoi(struct nguoi a[],int n){

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){

printf("ko tim thay!\n");

void main(){

int i,n;

struct nguoi a[100];

printf("nhap so luong nguoi:");

scanf("%d",&n);

getchar();

for(i=0;i<n;++i){

nhapthongtin(&a[i]);

printf("danh sach vua nhap la:\n");

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);

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy