一:定义一个类
package com.cloud.Demo1;
public class Cat {
private String name;
private int age;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
pub...
分类:
Web程序 时间:
2015-08-01 19:00:45
阅读次数:
170
脑补一下基础的东西,return的用法。return的常用作用有以下两种第一种用法是返回参数所用的关键字,假如一个有返回值的方法执行完了之后需要返回一个参数,示例:public string functionTest(){String a = "abc";return a;}那么这个方法被调用之后就...
分类:
编程语言 时间:
2015-08-01 18:42:40
阅读次数:
152
题目:
Given two strings s and t, write a function to determine if t is an anagram of s.
For example,
s = "anagram", t = "nagaram", return true.
s = "rat", t = "car", return false.
Note:
Yo...
分类:
其他好文 时间:
2015-08-01 17:21:47
阅读次数:
82
大家可以敲写一下下面的练习代码,看下运行结果,都很简单,关键要理解。
if:
# include
int main(void)
{
int i = 1;
i = i + 1;
if(i>10);
i = 1;
printf("%d\n", i);
return 0;
}
if示例2:
# include
int main(void)
{
int ...
分类:
编程语言 时间:
2015-08-01 17:19:03
阅读次数:
140
C语言的一些简单操作练习。
互换两个数字:
# include
int main(void)
{
int i = 3;
int j = 5;
int t;
//将i与j的值交换
t = i;
i = j;
j = t;
printf("i = %d, j = %d\n", i, j);
return 0;
}
输出任意字符任意层的金字塔:
# includ...
分类:
编程语言 时间:
2015-08-01 17:18:43
阅读次数:
134
程序示例 1 #include 2 using namespace std; 3 class A 4 { 5 public: 6 A(); 7 ~A(); 8 int get() const{ return *i; } 9 void set(int x){ *i =...
分类:
其他好文 时间:
2015-08-01 17:12:06
阅读次数:
115
查询里的方法using System;using System.Collections.Generic;using System.Linq;using System.Web;/// /// CarBF 的摘要说明/// public class CarBF{ private DataClass...
分类:
Web程序 时间:
2015-08-01 17:10:05
阅读次数:
133
Valid AnagramGiven two stringssandt, write a function to determine iftis an anagram ofs.For example,s= "anagram",t= "nagaram", return true.s= "rat",t=...
分类:
编程语言 时间:
2015-08-01 17:07:15
阅读次数:
782
Implementint sqrt(int x).Compute and return the square root ofx.思路: 突然发现,二分真TM的是万能的。还有牛顿迭代法,数学的东西,头疼不想看了。还有传说中的“魔数”法,比math库效率都高,试了下RE - -。C++: 1 clas....
分类:
其他好文 时间:
2015-08-01 17:01:10
阅读次数:
128
PHP链式操作:形如:$db->where()->order()->limit()的语法模式,在一行代码中完成多个方法的调用。链式操作的关键在于被调用的对象方法返回对象本身。sql .= " where {$where}"; return $this; } public f...
分类:
Web程序 时间:
2015-08-01 16:59:49
阅读次数:
113