初学GUI,用Eclipse导出jar包,设定的最小化图标不能显示(hello.png文件放在项目的根目录下)。代码如下:
import javax.swing.JFrame;
import java.awt.Toolkit;
import java.awt.Image;
import java.net.URL;
public class GUITest {
public static vo...
一、最基本的用法cin>>
接收一个数字、字符、字符串,遇“空格”、“TAB”、“回车”都结束
例如: #include
using namespace std;
main ()
{
int a,b;
cin>>a>>b;
cout<<a+b<<endl;
}输入:5[回车]6[回车]
输出:11
(其中回车可替换成空格或者TA...
链表的归并排序
超时的代码
class Solution:
def merge(self, head1, head2):
if head1 == None:
return head2
if head2 == None:
return head1
# head1 and head2 point to the same link list
if head1 == he...
把基本知识过了一遍,发现了几个自己容易 出错的小程序,记录下来。。。。
1,关于try-catch异常
1,关于try-catch异常
package chapter5;
public class p101 {
public static void main(String args[])
{
int a[]=new int[3];
try{...
spring 属性注入时,类中必须有setter 和 getter方法。
spring 注入时,类中必须有setter 和 getter方法。...
static C语言
C语言程序可以看成由一系列外部对象构成,这些外部对象可能是变量或函数。而内部变量是指定义在函数内部的函数参数及变量。外部变量定义在函数之外,因此可以在许多函数中使用。由于C语言不允许在一个函数中定义其它函数,因此函数本身只能是“外部的”。
由于C语言代码是以文件为单位来组织的,在一个源程序所有源文件中,一个外部变量或函数只能在某个文件中定义一次...
简单的插入排序,总是超时,暂且放在这记录一下。
class Solution:
# @param head, a ListNode
# @return a ListNode
def insertionSortList(self, head):
if head == None or head.next == None:
return head
psuhead...
题:已知有个txt文件,在D:\menu.txt。
已知txt文件每行的格式均为
"AAAA_BBBB_..._CCCC","Y/N"
如果CCC为数字的话,该行数据过滤掉。
把过滤完的数据生成一个新的文件,或者打印出控制台。
例如
"TEST_ABC_12123","Y"
"TEST_BCD_DE_23242","N"
"TEST_BAD_DE",...