-
Notifications
You must be signed in to change notification settings - Fork 0
/
train.c
48 lines (43 loc) · 1.11 KB
/
train.c
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
#include <stdio.h>
int main () {
int N, M;
int A[100], B[100];
printf("Veuillez rentrer la taille de A ( Max 50 )");
scanf("%d", &N);
printf("Veuillez rentrer la taille de B ( Max 50 )");
scanf("%d", &M);
printf("*************Remplissage de A : *************\n");
for(int i = 0; i < N; i++)
{
printf("A[%d]=",i);
scanf("%d",&A[i]);
}
printf("*************Remplissage de B : *************\n");
for(int i = 0; i < M; i++)
{
printf("B[%d]=",i);
scanf("%d",&B[i]);
}
printf("*************Affichage de A : *************\n");
for(int i = 0; i < N; i++)
{
printf("%d ",i);
printf("%d\n",A[i]);
}
printf("*************Affichage de B : *************\n");
for(int i = 0; i < M; i++)
{
printf("%d ",i);
printf("%d\n",B[i]);
}
for(int i = 0; i < M; i++)
{
A[N+i]=B[i];
}
printf("*************Affichage de A apres la copie : *************\n");
for(int i = 0; i < N+M; i++)
{
printf("%d ",i);
printf("%d\n",A[i]);
}
}