某公司笔试真题。C/C++ codestruct Test1{int adouble bshort c}struct Test2{int ashort bdouble c
某公司笔试真题。
C/C++ code
struct Test1{ int a; double b; short c;};struct Test2{ int a; short b; double c;};struct Test3{ short a; double b; int c;};struct Test4{ short a; int b; double c;};struct Test5{ double a; int b; short c;};struct Test6{ double a; short b; int c;};void main(){ cout<<sizeof(double)<<endl; cout<<sizeof(int)<<endl; cout<<sizeof(short)<<endl; cout<<sizeof(Test1)<<endl; cout<<sizeof(Test2)<<endl; cout<<sizeof(Test3)<<endl; cout<<sizeof(Test4)<<endl; cout<<sizeof(Test5)<<endl; cout<<sizeof(Test6)<<endl; system("pause");}