Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- typedef struct Tanc
- {
- char ime[15];
- char zemja[15];
- }Tanc;
- typedef struct Tancer
- {
- char ime[20];
- char prezime[20];
- Tanc tanci[5];
- }Tancer;
- void tancuvanje(Tancer *t, int n, char *zemja)
- {
- int i;
- for(i=0; i<n; i++)
- {
- int j;
- for(j=0; j<5; j++)
- {
- if(strcmp(t[i].tanci[j].zemja, zemja)==0)
- {
- printf("%s %s %s\n", t[i].ime, t[i].prezime, t[i].tanci[j].ime);
- break;
- }
- }
- }
- }
- int main()
- {
- int n;
- scanf("%d", &n);
- int i;
- Tancer t[n];
- for(i=0; i<n; i++)
- {
- scanf("%s", &t[i].ime);
- scanf("%s", &t[i].prezime);
- int j;
- for(j=0; j<5; j++)
- {
- scanf("%s", &t[i].tanci[j].ime);
- scanf("%s", &t[i].tanci[j].zemja);
- }
- }
- char zemja[100];
- scanf("%s", &zemja);
- tancuvanje(t, n, zemja);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement