记录详情

Compile Error

/in/Main.java:1: error: illegal character: '#'
#include <iostream>
^
/in/Main.java:1: error: class, interface, or enum expected
#include <iostream>
         ^
/in/Main.java:4: error: class, interface, or enum expected
int main()
^
/in/Main.java:7: error: class, interface, or enum expected
	cin >> n;
	^
/in/Main.java:8: error: class, interface, or enum expected
	int *a = new int[n];
	^
/in/Main.java:9: error: class, interface, or enum expected
	for (int i = 0; i < n; i++)
	^
/in/Main.java:9: error: class, interface, or enum expected
	for (int i = 0; i < n; i++)
	                ^
/in/Main.java:9: error: class, interface, or enum expected
	for (int i = 0; i < n; i++)
	                       ^
/in/Main.java:12: error: class, interface, or enum expected
	}
	^
/in/Main.java:14: error: class, interface, or enum expected
	cin >> m;
	^
/in/Main.java:16: error: class, interface, or enum expected
	for (int i = 0; i < m; i++)
	^
/in/Main.java:16: error: class, interface, or enum expected
	for (int i = 0; i < m; i++)
	                ^
/in/Main.java:16: error: class, interface, or enum expected
	for (int i = 0; i < m; i++)
	                       ^
/in/Main.java:19: error: class, interface, or enum expected
		int min = 0;
		^
/in/Main.java:20: error: class, interface, or enum expected
		int max = n - 1; 
		^
/in/Main.java:21: error: class, interface, or enum expected
		int mid = 0; 
		^
/in/Main.java:22: error: class, interface, or enum expected
		int count = 0;
		^
/in/Main.java:23: error: class, interface, or enum expected
		while (min <= max) {
		^
/in/Main.java:25: error: class, interface, or enum expected
			mid = (min + max) / 2;
			^
/in/Main.java:26: error: class, interface, or enum expected
			if (a[mid] > number) {
			^
/in/Main.java:28: error: class, interface, or enum expected
			}
			^
/in/Main.java:31: error: class, interface, or enum expected
			}
			^
/in/Main.java:34: error: class, interface, or enum expected
			}
			^
/in/Main.java:40: error: class, interface, or enum expected
	}
	^
/in/Main.java:42: error: class, interface, or enum expected
}
^
25 errors

信息

递交者
类型
自测
题目
DS7-1 折半查找的查找次数
语言
Java
递交时间
2019-05-11 11:24:04
评测时间
2019-05-11 11:24:04
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes