#28507: CPP


11030067@mail.hpsh.tp.edu.tw (和平110級鄧雨珊)

學校 : 臺北市立和平高級中學
編號 : 163096
來源 : [61.64.210.174]
最後登入時間 :
2022-10-23 16:54:59
b138. NOIP2005 1.陶陶摘苹果 -- NOIP2005普及組 | From: [219.85.157.240] | 發表日期 : 2021-12-14 23:20

#include <iostream>

 

using namespace std;

 

int main(){

 

int a[10], h;

 

for (int i=0; i<=9; i++){

 

cin >> a[i];

 

}

 

cin >> h;

 

int ans=0;

 

for (int i=0; i<10; i++){

 

if (a[i]<=h+30){

 

ans++;

 

}

 

}

 

cout << ans <<endl;

 

}
 
#28508: Re:CPP


11030067@mail.hpsh.tp.edu.tw (和平110級鄧雨珊)

學校 : 臺北市立和平高級中學
編號 : 163096
來源 : [61.64.210.174]
最後登入時間 :
2022-10-23 16:54:59
b138. NOIP2005 1.陶陶摘苹果 -- NOIP2005普及組 | From: [219.85.157.240] | 發表日期 : 2021-12-14 23:22

#include <iostream>

 

using namespace std;

 

int main(){

 

int a[10], h;

 

for (int i=0; i<=9; i++){

 

cin >> a[i];

 

}

 

cin >> h;

 

int ans=0;

 

for (int i=0; i<10; i++){

 

if (a[i]<=h+30){

 

ans++;

 

}

 

}

 

cout << ans <<endl;

 

}

invisible

 
ZeroJudge Forum