Advertisement
Guest User

Untitled

a guest
Jul 31st, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public class Main {
  4.  
  5. public static void main(String[] args) {
  6. Scanner scn = new Scanner(System.in);
  7. int n=scn.nextInt(),num=0;
  8. for(int i=1;i<=n-2;i++){
  9. for(int j=1;j<=n-2;j++){
  10. num=n-(i+j);
  11. if(num>n||num<=0)
  12. break;
  13. else
  14. System.out.println(i+" "+j+" "+num);
  15. }
  16. }
  17. }
  18.  
  19. /*
  20. 題目:[C_MM273-易] 鉛筆的分法
  21. 作者:1010
  22. 時間:西元 2016 年 7 月 */
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement