1123: 零起點學算法30——參加程序設計競賽
Time Limit: 1 Sec Memory Limit: 64 MB 64bit IO Format: %lldSubmitted: 3045 Accepted: 1353
[Submit][Status][Web Board]
Description
每年我們都有不少同學去參加程序設計競賽。
考慮到參賽名額的限制,我們的教練制定了以下規則:
(1)如果等級分排名前6或者訓練缺席次數不多於2次的隊伍允許代表學校參賽
(2)如果等級分排名前20且訓練缺席次數小於5次的允許參賽
Input
輸入2個正整數分別代表排名和缺席次數(多組數據)
Output
如果符合參賽規則,輸出yes否則輸出no(每組數據一行)
Sample Input 
6 1
Sample Output
yes
Source
1 #include<stdio.h> 2 int main(){ 3 int n,m; 4 while(scanf("%d%d",&n,&m)!=EOF){ 5 if(n<7||m<3) 6 printf("yes\n"); 7 else if(n<21&&m<5) 8 printf("yes\n"); 9 else 10 printf("no\n"); 11 } 12 return 0; 13 }