/ XMU_ACM / 题库 /

枚举排列

枚举排列

Background

Special for beginners, ^_^

Description

输入n
想办法按照字典序从小到大枚举1~n的所有排列
输出

Format

Input

n

Output

n!行
每行一个1~n的排列

Sample 1

Input

2

Output

12
21

Limitation

1s, 1024KiB for each test case.
n<=7

Hint

Free Pascal Code

var a,b:longint;
begin
    readln(a,b);
    writeln(a+b);
end.

C Code

#include <stdio.h>
int main(void)
{
    int a, b;
    scanf("%d%d", &a, &b);
    printf("%d\n", a + b);
    return 0;
}

C++ Code

#include <iostream>
using namespace std;
int main()
{
    int a, b;
    cin >> a >> b;
    cout << a + b << endl;
    return 0;
}

Python Code

a, b = [int(i) for i in raw_input().split()]
print(a + b)

Java Code

import java.io.*;
import java.util.Scanner;

public class Main {

    /**
     * @param args
     * @throws IOException 
     */
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        System.out.println(a + b);
    }
}

Source

Vijos Original

信息

难度
6
分类
(无)
标签
(无)
递交数
31
已通过
9
通过率
29%
上传者

相关

在下列训练计划中:

XMU ACM 2018