-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUntitled155.cpp
More file actions
64 lines (62 loc) · 1.16 KB
/
Untitled155.cpp
File metadata and controls
64 lines (62 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include<stdio.h>
#define NP 2
struct song
{
char auteur[64];
char titre[64];
int anne;
char list[64];
int nbchansons;
}hex[NP];
void focafich(struct song );
struct song foctake();
int main ()
{
int i;
char name;
int x;
for(i=0;i<NP;i++)
{
hex[i]=foctake();
}
for(i=0;i<NP;i++)
{
focafich(hex[i]);
}
printf("donnez le titre: ");
scanf("%s",&name);
for(i=0;i<NP;i++)
{
if(*hex[i].auteur==name)
{
focafich(hex[i]);
x=1;
break;
}
}
if(x=!1)
printf("le titre n\'existe pas dans la mimoire");
}
struct song foctake()
{
struct song atr;
printf("donnez l\'auteur:\n");
scanf("%s",&atr.auteur);
printf("donnez le titre:\n");
scanf("%s",&atr.titre);
printf("donnez le list:\n");
scanf("%s",&atr.list);
printf("donnez l\'anne:\n");
scanf("%d",&atr.anne);
printf("donnez le nomber de chasone:\n");
scanf("%d",&atr.nbchansons);
return(atr);
}
void focafich(struct song atr )
{
printf("l\'auteur:%s\n",atr.auteur);
printf("le titre:%s\n",atr.titre);
printf("l\'anne:%d\n",atr.anne);
printf("le list:%s\n",atr.list);
printf("le nomber de chasone:%d\n",atr.nbchansons);
}