使用comp來sort
bool comp(int a, int b){
if(a%10==b%10) return a>b;
else return a%10<b%10;
}
sort(arr, arr+n, comp);
剛學會compare覺得酷
使用comp來sort
bool comp(int a, int b){
if(a%10==b%10) return a>b;
else return a%10<b%10;
}
sort(arr, arr+n, comp);
剛學會compare覺得酷
你的眼睛背叛了你的心~~~~~~