cout<<oct<<x<<endl;
cout<<dec<<x<<endl;
cout<<hex<<x<<endl;
cout<<boolalpha<<y<<endl;
cout<<dec<<x<<endl;
cout<<hex<<x<<endl;
cout<<boolalpha<<y<<endl;
2015-09-23
cout<<x<<endl;
cout<<"x+y="<<x+y<<endl;
cin>>x;
cin>>x>>y;
cout<<"x+y="<<x+y<<endl;
cin>>x;
cin>>x>>y;
2015-09-23
已采納回答 / onemoo
getMaxOrMin函數的第一個參數arr是int指針,并不是數組(其實是一樣的,見回復的最后一段)。將參數聲明為int數組要這樣寫 int arr[]。 (如果寫成 int *arr[] 的話,是聲明了一個int指針的數組)你是不是說:另有一個數組,假設為 int a[3];調用函數時是這樣傳參的: getMaxOrMin(a, ...) ? ?為什么聲明第一個參數為指針,卻傳入了一個數組名??這樣傳參數是正確的。如之前所說:數組在作右值時會自動轉換為指向其首元素的指針。用數組名傳參數就是把數組作為右...
2015-09-22