Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- remplir_tab(t,n);
- supp (int T,x,n);
- aff_tab (t,n);
- main() {
- int y;
- int i,n;
- int T[50];
- do { printf("donner n");
- scanf("%d",&n) ;
- } while ((n>0) && ( n<= 50) );
- void remplir_tab (int *T;int n) {
- for (i=0;i<n;i++) {
- printf("donner le nbr de case \n");
- scanf("%d",&T[i]);
- }
- }
- int nbr_occ (int T;int x;int n) {
- y =0;
- scanf("%d",&x);
- for (i=0;i<=n;i++) {
- if ( T[i] == x) {
- y++;
- }
- }
- return y;
- void supp (int T;int x;int n) {
- k=0;
- for (i=0;i<=n;i++) {
- if ( T[i] = x ) {
- k = i;
- }
- if (k = n) { n=n-1 }
- else if (k <= 0) {
- printf("l entier x n existe pas");
- }
- else {
- for (j=k;j<=n;j++)
- {
- T[j] = T[j+1] ;
- }
- n=n-1;
- }
- }
- void aff_tab (int *T;int n) {
- for (i=0;i<n;i++) {
- printf(" %d \n",T[i]);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement