目录
A题-抽奖

思路:逻辑题,需要实时记录当前的星辉数和剩余的发数,只要剩余的星辉数大于等于5,则可以兑换一次发数。AC代码如下:
import java.util.Scanner;
public class Main {
static int x ;
static int ans ;
static int star ;
static int leave ;
public static void main(String[] args) {
Scanner input = new Scanner(System.in) ;
x = input.nextInt() ;
ans = x / 160; //原石能抽的发数
star = ans / 10 * 3; //当前的星辉数量
leave = ans % 10 ; //剩余的发数
while(star>=5) {
int temp = st
订阅专栏 解锁全文
——热身赛&spm=1001.2101.3001.5002&articleId=123507325&d=1&t=3&u=b2d9032971fd4117ac49c85d867d86fb)
2894

被折叠的 条评论
为什么被折叠?



