1. int read()
    2. {
    3. int x = 0, f = 1;
    4. char c = getchar();
    5. while (c < '0' || c>'9') {
    6. if (c == '-') f = -1;
    7. c = getchar();
    8. }
    9. while (c >= '0' && c <= '9')
    10. x = x * 10 + c - '0';
    11. c = getchar();
    12. return x * f;
    13. }