解题思路:
注意事项:
参考代码:import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
if (x % 4 == 1) {
System.out.print(0 + " ");
System.out.print(1 + " ");
System.out.print(x / 4 - 1);
} else if (x % 4 == 0) {
System.out.print(0 + " ");
System.out.print(0 + " ");
System.out.print(x / 4);
} else if (x % 4 == 2) {
System.out.print(1 + " ");
System.out.print(0 + " ");
System.out.print(x / 4 - 1);
} else {
System.out.print(1 + " ");
System.out.print(1 + " ");
System.out.print(x / 4 - 2);
}
}
}
0.0分
2 人评分
C语言训练-计算1~N之间所有奇数之和 (C语言代码)浏览:757 |
C语言程序设计教程(第三版)课后习题8.4 (C语言代码)浏览:575 |
母牛的故事 (C语言代码)浏览:992 |
C语言训练-求PI* (C语言代码)浏览:639 |
C语言程序设计教程(第三版)课后习题5.8 (C语言代码)浏览:683 |
C语言程序设计教程(第三版)课后习题6.8 (C语言代码)浏览:544 |
C语言程序设计教程(第三版)课后习题9.4 (C语言代码)浏览:699 |
a+b浏览:452 |
1024题解浏览:879 |
剪刀石头布 (C语言代码)浏览:1519 |