#include <stdio.h>
void nhapmang( int a[ ] , int & n)
{
printf ( "nhap vao so phan tu mang : " ) ; for ( int i= 0 ; i< n; i++ )
{
}
}
void xuatmang( int a[ ] , int n)
{
printf ( "cac phan tu trong mang la : " ) ; for ( int i= 0 ; i< n; i++ )
{
}
}
void xoakytu( int a[ ] , int * n)
{
int x;
printf ( "nhap vao so muon xoa: " ) ; hiep:
for ( int i= 0 ; i<* n; i++ )
{
if ( a[ i] == x)
{
for ( int u= i ; u<* n ; u++ )
{
a[ u] = a[ u+ 1 ] ;
}
* n=* n- 1 ;
goto hiep;
}
}
}
main( )
{
int a[ 100 ] , n, x;
nhapmang( a, n) ;
xuatmang( a, n) ;
xoakytu( a,& n) ;
xuatmang( a, n) ;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIG5oYXBtYW5nKGludCBhW10sIGludCAmbikKewoJcHJpbnRmKCJuaGFwIHZhbyBzbyBwaGFuIHR1IG1hbmcgOiAiKTsKCXNjYW5mKCIlZCIsICZuKTsKCWZvcihpbnQgaT0wO2k8bjtpKyspCgl7CgkJcHJpbnRmKCJhWyVkXT0gIiwgaSk7CgkJc2NhbmYoIiVkIiwgJmFbaV0pOwoJfQp9Cgp2b2lkIHh1YXRtYW5nKGludCBhW10sIGludCBuKQp7CglwcmludGYoImNhYyBwaGFuIHR1IHRyb25nIG1hbmcgbGEgOiAiKTsKCWZvcihpbnQgaT0wO2k8bjtpKyspCgl7CgkJcHJpbnRmKCJcbmFbJWRdPSAlZCIsaSxhW2ldKTsKCX0KfQoKdm9pZCB4b2FreXR1KGludCBhW10sIGludCAqbikKewoJaW50IHg7CglwcmludGYoIm5oYXAgdmFvIHNvIG11b24geG9hOiAiKTsKCXNjYW5mKCIlZCIsICZ4KTsKCWhpZXA6Cglmb3IoaW50IGk9MDtpPCpuO2krKykKCXsKCQlpZihhW2ldPT14KQoJCXsKCQkJZm9yKGludCB1PWkgOyB1PCpuIDsgdSsrKQoJCQl7CgkJCQlhW3VdPWFbdSsxXTsKCQkJfQoJCSAgKm49Km4tMTsKCQkgIGdvdG8gaGllcDsKCQkJCX0KCQkJfQoJCX0KbWFpbigpCnsKCWludCBhWzEwMF0sbix4OwoJbmhhcG1hbmcoYSwgbik7Cgl4dWF0bWFuZyhhLG4pOwoJeG9ha3l0dShhLCZuKTsKCXh1YXRtYW5nKGEsbik7Cn0=
compilation info
prog.c:3:28: error: expected ';', ',' or ')' before '&' token
void nhapmang(int a[], int &n)
^
prog.c:42:1: warning: return type defaults to 'int' [-Wimplicit-int]
main()
^
prog.c: In function 'main':
prog.c:45:2: warning: implicit declaration of function 'nhapmang' [-Wimplicit-function-declaration]
nhapmang(a, n);
^
prog.c:44:15: warning: unused variable 'x' [-Wunused-variable]
int a[100],n,x;
^
stdout