this 指针 的使用。
L4B100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库#include <iostream>
L4B100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库using namespace std;
L4B100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库class Point
L4B100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库{
L4B100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库private:
L4B100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库int x, y;
L4B100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库public:
L4B100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库Point(int a, int b)
L4B100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库{
L4B100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库x=a;
L4B100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库y=b;
L4B100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库}
L4B100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库void MovePoint(int a, int b)
L4B100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库{
L4B100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库x += a;
L4B100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库y += b;
L4B100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库}
L4B100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库void print()
L4B100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库{
L4B100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库cout << "x=" << x << endl;
L4B100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库}
L4B100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库};
L4B100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库int main()
L4B100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库{
L4B100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库Point point1(10, 10);
L4B100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库point1.MovePoint(2, 2);
L4B100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库point1.print();
L4B100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库return 0;
L4B100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库}
L4B100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库程序运行结果:
L4B100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库x=12