#include <stdio.h>
#include <math.h>
#include <stdlib.h>
void nhapmang( int a[ ] , int & n) {
printf ( "nhap vao so luong phan tu: " ) ; 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++ ) {
printf ( "\n A[%d]= %d" , i
, a
[ i
] ) ; }
}
int sochinhphuong( int x)
{
int i, n;
for ( i= 0 ; i< n; i++ )
{
return 1 ;
return 0 ;
}
}
void inrasochinhpguong( int a[ ] , int n) {
for ( int i= 0 ; i< n; i++ ) {
if ( sochinhphuong( a[ i] ) ) {
printf ( "\n SCP= %d\n \t \t " , a
[ i
] ) ; }
if ( sochinhphuong( a[ i] ) == 0 )
}
}
main( )
{
int n, a[ 100 ] ;
nhapmang( a, n) ;
xuatmang( a, n) ;
inrasochinhpguong( a, n) ;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxtYXRoLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4Kdm9pZCBuaGFwbWFuZyhpbnQgYVtdLCBpbnQgJm4pewoJcHJpbnRmKCJuaGFwIHZhbyBzbyBsdW9uZyBwaGFuIHR1OiAiKTsKCXNjYW5mKCIlZCIsICZuKTsKCWZvcihpbnQgaT0wOyBpPG47aSsrKXsKCQlwcmludGYoIkFbJWRdPSAiLGkpOwoJCXNjYW5mKCIlZCIsICZhW2ldKTsKCX0KfQoKdm9pZCB4dWF0bWFuZyhpbnQgYVtdLCBpbnQgbil7CgkKCXByaW50ZigiY2FjIHBoYW4gdHUgdHJvbmcgbWFuZyBsYSA6ICIpOwoJZm9yKGludCBpPTA7aTxuO2krKyl7CgkJcHJpbnRmKCJcbkFbJWRdPSAlZCIsIGksYVtpXSk7Cgl9Cn0KCmludCBzb2NoaW5ocGh1b25nKGludCB4KQp7CglpbnQgaSxuOwoJZm9yKCBpPTA7IGk8bjtpKyspCgl7CgkJaWYoc3FydCh4KSpzcXJ0KHgpPT14KQoJCQlyZXR1cm4gMTsKCQkJCXJldHVybiAwOwoJfQoJCQkJCn0KCnZvaWQgaW5yYXNvY2hpbmhwZ3VvbmcoaW50IGFbXSwgaW50IG4pewoJZm9yKGludCBpPTA7aTxuO2krKyl7CgkJaWYoc29jaGluaHBodW9uZyhhW2ldKSl7CgkJCXByaW50ZigiXG5TQ1A9ICVkXG5cdFx0IiwgYVtpXSk7CgkJfQoJCWlmKHNvY2hpbmhwaHVvbmcoYVtpXSk9PTApCgkJcHJpbnRmKCJraG9uZyBjbyBTQ1AiKTsKCQkKCX0KfQoKbWFpbigpCnsKCWludCBuLCBhWzEwMF07CgluaGFwbWFuZyhhLG4pOwoJeHVhdG1hbmcoYSxuKTsKCWlucmFzb2NoaW5ocGd1b25nKGEsbik7CgkKfQ==
compilation info
prog.c:4:28: error: expected ';', ',' or ')' before '&' token
void nhapmang(int a[], int &n){
^
prog.c:44:1: warning: return type defaults to 'int' [-Wimplicit-int]
main()
^
prog.c: In function 'main':
prog.c:47:2: warning: implicit declaration of function 'nhapmang' [-Wimplicit-function-declaration]
nhapmang(a,n);
^
prog.c: In function 'sochinhphuong':
prog.c:31:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
stdout