CMake測試沒問題 這裡測試會炸開
以下是我的程式碼
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
int nr,n,day[3],d,dayr = 0;
while(cin >> n >> d)
{
for (int i = 0;i < n; i++) {
for (int j = 0; j < 3; j++) {
cin >> day[j];
}
sort(day, day + 3);
if (day[2] - day[0] >= d)
{
nr = nr+1;
dayr = dayr + (day[0] + day[1] + day[2])/3;
}
}
cout << nr <<" "<< dayr;
}
return 0;
}