#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
const int MAXN =
5;
namespace AA
{
int x =
20;
int y =
30;
}
class Aassd
{
public:
int x;
void outx(){
cout << x << endl;
}
};
class Bassd
{
public:
int x;
int y;
int arr[
5];
void outx(){
cout << x << endl;
}
void outy(){
cout << y << endl;
}
void outarr(){
for(
int i=
0; i<MAXN; i++ ){
cout << arr[i] << endl;
}
}
};
int gax(
float a,
int b );
int gax(
int a,
int b,
int c);
int gax(
int a,
int c );
int gax(
float a,
float b,
double c,
double d);
int main()
{
Aassd coor;
coor.x =
10 ;
coor.outx();
Bassd *coortwo =
new Bassd();
if( coortwo == NULL ){
return 0;
}
coortwo->x = AA::x;
coortwo->y = AA::y;
coortwo->outx();
coortwo->outy();
for(
int i=
0; i<MAXN; i++ )
{
coortwo->arr[i] = i;
}
coortwo->outarr();
delete coortwo;
coortwo = NULL;
gax(AA::x,AA::y);
printf(
"\n");
gax((
float)AA::x,AA::y);
printf(
"\n");
float mid = AA::x*
1.23;
gax(mid,AA::x,AA::y,AA::y);
return 0;
}
int gax(
float a,
int b )
{
cout <<
"1 //" << a <<
" " << b << endl;
}
int gax(
int a,
int b,
int c){
cout <<
"2 //" << a <<
" " << b <<
" " << c << endl;
}
int gax(
int a,
int c ){
cout <<
"3 //" << a <<
" " << c << endl;
}
int gax(
float a,
float b,
double c,
double d){
cout <<
"4 //" << a <<
" " << b <<
" " << c <<
" " << d << endl;
}
转载请注明原文地址: https://ju.6miu.com/read-678215.html