Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(){
- int n, q, in;
- scanf("%d", &n);
- struct{
- int id, d, m, y;
- char name[11], address[11];
- }data[n];
- for(int i=0;i<n;i++){
- scanf("%d %d %d %d %s %s", &data[i].id, &data[i].d, &data[i].m, &data[i].y, &data[i].name, &data[i].address);
- }
- scanf("%d", &q);
- while(q--){
- scanf("%d", &in);
- for(int i=0;i<n;i++){
- if(data[i].id==in){
- printf("%d. %s was born on %d/%d/%d and live at %s\n", data[i].id, data[i].name, data[i].d, data[i].m, data[i].y, data[i].address);
- break;
- }
- if(i==n-1){
- printf("No data found!\n");
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement