#include <iostream>
using namespace std;
int main()
{
int n, value,av,sum = 0;
cin >> n;
for(int i=1;i<=n;i++)
{
cin >> value;
sum+=value;
}
av=sum/n;
if (av>=7.5)
{
cout<<"READY";
}
else{
cout<<"NOT READY";
}
return 0;
}
如何设置输入值的限制,使其大于或等于0
且小于或等于10
。我尝试了while
和if
,但随后改变了ouptut。请帮忙
答案 0 :(得分:0)
public class Enemy {
Bitmap enemyBitmap;
int enemySpeed, screenX;
boolean isEnemyMoving;
Random random;
public Enemy (Context context, int screenX) {
this.screenX = screenX;
enemyBitmap = BitmapFactory.decodeResource(context.getResources(), R.mipmap.ic_launcher);
random = new Random();
isEnemyMoving = true;
enemySpeed = - 3;
}
public int getEnemySpeed () {
return enemySpeed;
}
public Bitmap getEnemyBitmap () {
return enemyBitmap;
}
}