参考代码:
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int []arr = new int[12]; for(int i = 0; i < 12; i++) { arr[i] = scanner.nextInt(); } int hand = 0; int mom = 0; for(int i = 1; i <= 12; i++) { hand += 300 - arr[i - 1]; if(hand < 0) { System.out.println(-i); return; } if(hand % 100 != 0) { mom += hand / 100 * 100; hand -= hand / 100 * 100; } } int res = hand + mom * 6 / 5; System.out.println(res); } }
0.0分
6 人评分
C语言程序设计教程(第三版)课后习题7.2 (C语言代码)浏览:605 |
C语言程序设计教程(第三版)课后习题11.1 (C语言代码)浏览:623 |
简单的a+b (C语言代码)浏览:520 |
C语言程序设计教程(第三版)课后习题3.7 (C语言代码)浏览:561 |
数对 (C语言代码)浏览:697 |
A+B for Input-Output Practice (III) (C语言代码)浏览:564 |
A+B for Input-Output Practice (V) (C语言代码)浏览:459 |
蚂蚁感冒 (C语言代码)浏览:768 |
C二级辅导-公约公倍 (C语言代码)浏览:482 |
模拟计算器 (C语言代码)浏览:2299 |