fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. struct D{
  5. short int i;
  6. };
  7.  
  8. struct V{
  9. short int c;
  10. };
  11.  
  12. int main(){
  13. D s;
  14. D &x=s;
  15. s.i=3;
  16. x.i=4;
  17. cout<<s.i+x.i<<endl;
  18.  
  19. V v;
  20. V &n=v;
  21. v.c=8;
  22. n.c=5+v.c;
  23. cout<<n.c<<endl;
  24. }
Success #stdin #stdout 0s 4224KB
stdin
7 2
stdout
8
13