记录详情

Compile Error

/in/Main.java:1: error: class, interface, or enum expected
function NumberOf1Between1AndN_Solution(n) {
^
/in/Main.java:3: error: class, interface, or enum expected
    var high, low, cur, temp, i = 1;
    ^
/in/Main.java:4: error: class, interface, or enum expected
    high = n;
    ^
/in/Main.java:5: error: class, interface, or enum expected
    var count = 0;
    ^
/in/Main.java:6: error: class, interface, or enum expected
    while (high !== 0) {
    ^
/in/Main.java:8: error: class, interface, or enum expected
        temp = n % Math.pow(10, i);
        ^
/in/Main.java:9: error: class, interface, or enum expected
        cur = parseInt(temp / Math.pow(10, i - 1));
        ^
/in/Main.java:10: error: class, interface, or enum expected
        low = temp % Math.pow(10, i - 1); 
        ^
/in/Main.java:11: error: class, interface, or enum expected
        if (cur === 1) {
        ^
/in/Main.java:13: error: class, interface, or enum expected
        } else if (cur < 1) {
        ^
/in/Main.java:15: error: class, interface, or enum expected
        } else {
        ^
/in/Main.java:17: error: class, interface, or enum expected
            count += (high + 1) * Math.pow(10, i - 1);
            ^
/in/Main.java:18: error: class, interface, or enum expected
        }
        ^
/in/Main.java:20: error: class, interface, or enum expected
    }
    ^
/in/Main.java:22: error: class, interface, or enum expected
}
^
15 errors

信息

递交者
类型
递交
题目
判断1的个数
比赛
CYBC Python Online_11
语言
Java
递交时间
2020-05-24 17:42:18
评测时间
2020-05-24 17:42:18
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes