解题思路:
注意事项:
参考代码:
public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int result=0; while(n>=3) { n-=2; result+=3; } result+=n; //最后结果要记得加上余数; System.out.println(result); } }
0.0分
0 人评分