#include<iostream> using namespace std; //定义结构体 struct point { int x; int y; void output() { cout << x << endl << y << endl; } }; int main() { point pt; pt.x = 10; pt.y = 20; pt.output(); return 0; }