當前位置:編程學習大全網 - 電腦編程 - c++編程題,我這個破代碼跑不出來啊,求大神糾錯啊啊啊啊啊啊啊,在線等,,,,,

c++編程題,我這個破代碼跑不出來啊,求大神糾錯啊啊啊啊啊啊啊,在線等,,,,,

if(compare(stu[max],stu[i]}==-1),這個用法上就錯了。

2種改法,壹是把friend int compare(student &s1,student &s2)函數變成類外部函數,壹種是修改

if(compare(stu[max],stu[i]}==-1)的用法,應該改為

friend int compare(student &s2) {

f(age>s2.age)

return 1;

else if(age==s2.age)

return 0;

else return-1;

}

而調用方法則改為:

if (stu[max].compare(stu[i])==-1)

...

  • 上一篇:請列出十種常用的編程語言
  • 下一篇:有哪些傻瓜式的可視化工具
  • copyright 2024編程學習大全網