#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
struct node {
int x, y;
node () {};
node (int x, int y) :
x(x), y(y) {};
};
int main() {
node a;
node b(1, 2);
node c = node(1, 2);
printf("a = %d %d\n", a.x, a.y);
printf("b = %d %d\n", b.x, b.y);
printf("c = %d %d\n", c.x, c.y);
return 0;
}
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
struct node {
int x, y;
//node () {};
node (int x = 0, int y = 0) :
x(x), y(y) {};
};
int main() {
node a;
node b(1, 2);
node c = node(1, 2);
printf("a = %d %d\n", a.x, a.y);
printf("b = %d %d\n", b.x, b.y);
printf("c = %d %d\n", c.x, c.y);
return 0;
}
留个底, 防止忘记