Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class Main {
- public static void main(String[] args) {
- Scanner scn = new Scanner(System.in);
- int n=scn.nextInt(),num=0;
- for(int i=1;i<=n-2;i++){
- for(int j=1;j<=n-2;j++){
- num=n-(i+j);
- if(num>n||num<=0)
- break;
- else
- System.out.println(i+" "+j+" "+num);
- }
- }
- }
- /*
- 題目:[C_MM273-易] 鉛筆的分法
- 作者:1010
- 時間:西元 2016 年 7 月 */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement