#45993: bless Curry can come back as soon as possible


1121226@stu.wghs.tp.edu.tw (Arthur✨EC)

學校 : 臺北市私立薇閣高級中學
編號 : 252772
來源 : [60.248.154.139]
最後登入時間 :
2025-08-21 12:59:45

#include <bits/stdc++.h>
using namespace std;
int main(){
  int a,b;
  cin>>a>>b; // 輸入
  int num=0,total=0;
  for(int i=0;i<a;i++){
    int c[3]; // 陣列
    cin>>c[0]>>c[1]>>c[2];
    int max=*max_element(c, c+3); // 找最大值
    int min=*min_element(c, c+3); // 找最小值
    if(max-min>=b){ // 判斷
      num++; // 計數
      total+=(c[0]+c[1]+c[2])/3; // 總和
    }
  }
  cout<<num<<" "<<total;
  return 0;
}
#45995: Re: bless Curry can come back as soon as possible


hansjiang1017@gmail.com (可以出題了!!!!!!!!!!!!!!!)

學校 : 不指定學校
編號 : 278037
來源 : [111.242.104.111]
最後登入時間 :
2025-08-06 18:37:22

#include 
using namespace std;
int main(){
  int a,b;
  cin>>a>>b; // 輸入
  int num=0,total=0;
  for(int i=0;iint c[3]; // 陣列
    cin>>c[0]>>c[1]>>c[2];
    int max=*max_element(c, c+3); // 找最大值
    int min=*min_element(c, c+3); // 找最小值
    if(max-min>=b){ // 判斷
      num++; // 計數
      total+=(c[0]+c[1]+c[2])/3; // 總和
    }
  }
  cout<" "<return 0;
}


agree