#include <stdio.h>
int is_sufficient(const int* cur_avail, const int* cur_req){
for(int i = 0; i < 3; i++){
if(cur_avail[i] < cur_req[i]){
return 0;
}
}
return 1;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| chrome: | |
| +t 新 tab | |
| +shit+t 打开最近关闭的 tab | |
| +n 新窗口 | |
| +l 地址栏 | |
| +o 打开文件 | |
| +w 关闭 tab | |
| +r reload | |
| +shift+r force reload | |
| +shift+{ 上一个 tab |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 原文:http://www.malcolmhardie.com/weblogs/angus/2004/10/23/java-filewriter-xml-and-utf-8/ | |
| Java FileWriter 默认是用(ISO-8859-1 or US-ASCII)西方编码的,总之不是UTF-8的,而FileWriter类有getEncoding方法,却没有setEncoding的方法,如下的写法可以使正确输出UTF-8的文件: | |
| OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(path),"UTF-8"); | |
| 或者 | |
| Writer out = new BufferedWriter( new OutputStreamWriter(new FileOutputStream(this.outputFilename),”UTF-8″)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| http://yikun.github.io/2015/04/06/Java-TreeMap%E5%B7%A5%E4%BD%9C%E5%8E%9F%E7%90%86%E5%8F%8A%E5%AE%9E%E7%8E%B0/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| https://stackoverflow.com/questions/1509391/how-to-get-the-one-entry-from-hashmap-without-iterating |
NewerOlder