ccf認證考試試題答案
CCF,中國計算機學會,英文全稱為China Computer Federation,簡稱CCF,成立於1962年,是中國計算機科學與技術領域群眾性學術團體,屬一級學會,獨立法人單位,是中國科學技術協會的成員。下面是小編整理的關於ccf認證考試試題答案,歡迎大家參考!
1. 出現次數最多的數
import .*;
public class Main {
public static void main(String[] args) {
new Main()();
}
public void run() {
Scanner fin = new Scanner();
int N = Int();
int[] count = new int[10001];
for (int i = 0; i < N; ++i) {
++count[Int()];
}
int maxCount = -1;
int result = 0;
for (int i = 1; i <= 10000; ++i) {
if (count[i] > maxCount) {
maxCount = count[i];
result = i;
}
}
tln(result);
}
}
號碼
import eredReader;
import tStreamReader;
public class Main {
} public static void main(String args[]) { } BufferedReader bin = new BufferedReader(new InputStreamReader()); try{ } int sum=0;char cc='0'; String isbn_0 = Line(); String isbn = isbn_ace("-", ""); for(int i=0; i<9; i++){ } sum = sum % 11; if(sum == 10) cc = 'X';// else cc = (char)(sum+48); if(cc == At(9)) tln("Right"); else{ } tStackTrace(); isbn_0 = isbn_tring(0,12) + cc; tln(isbn_0); int ii = (int)At(i)-48; sum += ii * (i+1); }catch(Exception e){
3.最大的`矩形
import .*;
public class Main {
public static void main(String[] args) {
new Main()();
}
public void run() {
Scanner fin = new Scanner();
int N = Int();
int[] height = new int[N];
for (int i = 0; i < N; ++i) height[i] = Int();
int result = 0;
for (int i = 0; i < N; ++i) {
int width = 1;
for (int j = i - 1; j >= 0; --j) {
if (height[j] < height[i]) break;
++width;
}
for (int j = i + 1; j < N; ++j) {
if (height[j] < height[i]) break;
++width;
}
int area = width * height[i];
result = (result, area);
}
tln(result);
}
}
4.有趣的數
import .*;
public class Main {
public static void main(String[] args) {
new Main()();
}
public void run() {
Scanner fin = new Scanner();