AIR_King @ 2017-09-01 23:02:01
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
using namespace std;
int main()
{
int ans=0,n,a,b,c,d,e,f,g,h,i,j;
scanf("%d%d%d%d%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f,&g,&h,&i,&j);
scanf("%d",&n);
if(n+30>=a) ans++;
if(n+30>=b) ans++;
if(n+30>=c) ans++;
if(n+30>=d) ans++;
if(n+30>=e) ans++;
if(n+30>=f) ans++;
if(n+30>=g) ans++;
if(n+30>=h) ans++;
if(n+30>=i) ans++;
if(n+30>=j) ans++;
printf("%d\n",ans);
return 0;
}
by 起名真的很难 @ 2017-09-01 23:15:52
其实你可以用switch
by 起名真的很难 @ 2017-09-01 23:16:31
额等一下,我好像认识你
by VenusM1nT @ 2017-09-02 09:03:26
那你用while啊
by 冰の妖精 @ 2017-09-07 21:40:11
不想用for的带我一个2333333
#include <iostream>
using namespace std;
int a, b, c, d, e, f, g, h, i, j, n, ans;
int main()
{
cin >> a >> b >> c >> d >> e >> f >> g >> h >> i >> j;
cin >> n;
if (n + 30 >= a) ans++;
if (n + 30 >= b) ans++;
if (n + 30 >= c) ans++;
if (n + 30 >= d) ans++;
if (n + 30 >= e) ans++;
if (n + 30 >= f) ans++;
if (n + 30 >= g) ans++;
if (n + 30 >= h) ans++;
if (n + 30 >= i) ans++;
if (n + 30 >= j) ans++;
cout << ans << endl;
return 0;
}