不是VIP会员,不能显示答案

题目解答

题目:
#include <iostream>
using namespace std;
struct point {
    int x;
    int y;
};

int main() {
    struct EX{
         int a;
         int b;
         point c;
    } e; 
   e.a = 1; 
   e.b = 2; 
   e.c.x = e.a + e.b;
   e.c.y = e.a * e.b; 
   cout << e.c.x << ',' << e.c.y << endl;
    return 0;

输出:3,2
考点: 0
分析:
解答: 定义了两个结构体,e.a=1,e.b=2,则e.c.x=e.a+e.b=3,e.c.y=e.a*e.b=2,但要注意答案输出时有个“,”,所以答案是3,2。
评论:
老师: 0