当前位置:网站首页>[daily question] first day
[daily question] first day
2022-07-02 18:50:00 【No. 101 of the top 100 most handsome faces in the Asia Pacific 】
️ Author: intellectuals
️ Personal blog : Old nine CSDN Blog
Personal famous saying : Uncontrollable things Optimistic face
Series column : A daily topic
List of articles
choice
Character Is a wrapper class , Cannot store string constants ,String Sure ,StringBuffer need new Objects can only be used ,Vector Is a collection
Method rewrite : There is an inheritance relationship , The method parent class required by the subclass cannot meet , The permission size of subclass method override must be greater than that of the parent class , Everything else is the same
Principles of structured programming : modularization , The top-down , Progressive refinement
The member variable is not initialized and defaults to 0
java The remainder can take decimals ,C Language doesn't work
Only static methods can be accessed with class names
Programming questions 1
The grouping method can be sorted from small to large , Then take the first and last two to form a group
The formula :arr.len-2*(i+1)
public class test1 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
while (scan.hasNextInt()) {
int n = scan.nextInt();
int[] array = new int[3 * n];
long sum = 0;
for (int i = 0; i < 3 * n; i++) {
array[i] = scan.nextInt();
}
Arrays.sort(array);
for (int i = 0; i < n; i++) {
sum += array[array.length - 2 * (i + 1)];
}
System.out.println(sum);
}
}
}
Programming questions 2
1. Traverse str2 This string , Put the corresponding characters in hash[]
2. Traverse str1, find == 0 Is the character you want
public class test1 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String str1 = scan.nextLine();
String str2 = scan.nextLine();
HashMap<Character,Integer> map = new HashMap();
for(int i = 0;i<str2.length();i++){
if(map.get(str2.charAt(i)) == null){
map.put(str2.charAt(i),1);
}else{
map.put(str2.charAt(i),map.get(str2.charAt(i))+1);
}
}
String ret = "";
for(int i = 0;i< str1.length();i++){
if(map.get(str1.charAt(i)) == null){
ret += str1.charAt(i);
}
}
System.out.println(ret);
}
}
————————————————————————
It's not easy to code words , Everyone's support is my driving force to stick to it
Copyright notice : This paper is about CSDN Blogger 「 The top 100 most handsome faces in the Asia Pacific region 101 name 」 The original article of
边栏推荐
- 夜神模拟器+Fiddler抓包测试App
- Unity learning shader notes [81] simple color adjustment post-processing (brightness, saturation, contrast)
- Looking for innocence in New York -- a beautiful day at the discovery center of Legoland, New Jersey
- Leetcode interview question 16.15 Abacus wonderful calculation
- 27:第三章:开发通行证服务:10:【注册/登录】接口:注册/登录OK后,把用户会话信息(uid,utoken)保存到redis和cookie中;(一个主要的点:设置cookie)
- @Component cannot get Dao layer
- PR曲线和ROC曲线概念及其区别
- Esp32-c3 introductory tutorial question ⑪ - ESP tls: create_ ssl_ handle failed, tls_ io_ instance->options. trusted_ certs null
- Rte11 interrupt decoupling function
- options should NOT have additional properties
猜你喜欢
什么是云原生?这回终于能搞明白了!
距离度量 —— 杰卡德距离(Jaccard Distance)
Ue4 dessine un cercle avec une ligne de contour
Another double non reform exam 408, will it be cold? Software College of Nanchang Aviation University
UML class diagram
阿里三面被面试官狂问Redis,简历上再也不敢写'精通'了
Troubleshooting: kubectl reports an error validationerror: unknown field \u00a0
LightGroupButton* sender = static_cast<LightGroupButton*>(QObject::sender());
UE4 draw a circle with spline
Looking for innocence in New York -- a beautiful day at the discovery center of Legoland, New Jersey
随机推荐
iptable端口重定向 MASQUERADE[通俗易懂]
@Component 拿不到dao层
Three ways of function parameter transfer in C language
A simple PHP personal card issuing program v4.0
Leetcode interview question 17.01 Addition without plus sign
MySQL about only_ full_ group_ By limit
Unity learning shader notes [82] black and white processing of enhanced single channel color rendering
Leetcode (154) -- find the minimum value II in the rotation sort array
夜神模擬器+Fiddler抓包測試App
Google's official response: we have not given up tensorflow and will develop side by side with Jax in the future
Matlab中弧度转角度、角度转弧度
Radian to angle, angle to radian in MATLAB
Detailed explanation of cjson usage
Esp32-c3 introductory tutorial question ⑩ - error: implicit declaration of function 'ESP_ blufi_ close‘;
Mini Golf Course: a good place for leisure and tourism in London
Leetcode 面试题 16.11. 跳水板
材质UV遮罩的技巧
Ali was wildly asked by the interviewer on three sides. Redis dared not write 'proficient' on his resume anymore
Leetcode(81)——搜索旋转排序数组 II
Concepts and differences of PR curve and ROC curve