全部评论 1

  • a+b?!!!

    6天前 来自 浙江

    0
    • 不行啊,不用链表显得我太low了

      2天前 来自 江苏

      0
    • 我突然发现,这样就可以了

      //火车头不打了,会超2000字,需要的到上面去复制
      #include <bits/stdc++.h>
      using namespace std;
      int n, x;
      struct node {
      	int data;
      	node * next;
      };
      int main() {
      	const int MAX = 2;
          n = MAX;
      	node * head, * r, * p, * q;
      	head = new node;
      	head -> next = NULL;
      	r = head;
      	for(int i = 1; i <= n; i++) {
      		cin >> x;
      		p = new node;
      		p -> data = x;
      		p -> next = NULL;
      		r -> next = p;
      		r = p;
      	}
      	p = head;
      	while(p -> next != NULL) {
      		printf("%d", p -> next -> data + p -> next -> next -> data);
      		return 0; 
      		p = p -> next;
      	}
      	return 0;
      }
      

      2天前 来自 江苏

      0
    • 666啊,a+b!!

      昨天 来自 浙江

      0
首页