计算最长连续相同字符的个数
测试数据
输入:
aaaassdfg
adasafag
ssddffffgt
输出:
4
1
4
#include
#include
int main()
{
int i,n,t;
int b[105];
char a[105];
scanf("%d",&t);
while(t--)
{
...
分类:
其他好文 时间:
2014-06-11 06:40:08
阅读次数:
207
q '0'); 表示将q的所有位赋值为0,当q位数较多时比较方便。。。
信号属性函数:用来得到有关信号的行为功能信息;
信号‘event:当前的一个相当小的时间间隔内有信号事件发生,则返回’true’,否则返回‘false’;
关于conv_std_logic_vector 和 conv_integer 这两个函数的使用问题...
分类:
其他好文 时间:
2014-06-11 06:26:39
阅读次数:
240
非常巧妙的题目,巧用cmp,注意cmp的重载
#include
#include
using namespace std;
string a[55];
bool cmp(string a, string b){
return a+b > b+a;
}
int main(int argc, char const *argv[])
{
int n;
while(cin >...
分类:
其他好文 时间:
2014-06-11 06:10:28
阅读次数:
293
while loops
定义与实例
i = 0
numbers = []
while i < 6:
print "At the top i is %d" % i
numbers.append(i)
i = i + 1
print "Numbers now: ", numbers
print "At the bottom i is %d" % ...
分类:
编程语言 时间:
2014-06-11 00:59:17
阅读次数:
410
在前面我们在解决线程同步问题的时候使用了synchronized关键字,今天我们来看看Java 5.0以后提供的线程锁Lock.Lock接口的实现类提供了比使用synchronized关键字更加灵活和广泛的锁定对象操作,而且是以面向对象的方式进行对象加锁。 @Override
public void run() {
while(true){
Lock lock = new Re...
分类:
移动开发 时间:
2014-06-11 00:57:51
阅读次数:
329
Swift语言使用var定义变量,但和别的语言不同,Swift里不会自动给变量赋初始值,也就是说变量不会有默认值,所以要求使用变量之前必须要对其初始化。如果在使用变量之前不进行初始化就会报错:
1
2
3
4
5
var
stringValue : String
//error:
variable 'st...
分类:
其他好文 时间:
2014-06-11 00:44:59
阅读次数:
374
ORA-12520监听程序无法为请求的服务器类型找到可用的处理程序以下不知道是不是解决方法的方法,因为我只重启下oracle服务就好了,并没进行任何修改引用别人的文章:1)数据库是专用服务器,但是在tnsname.ora配置中设置了连接方式为shared,这种情况下打开tnsname.ora, 把(server = shared)改成(server = dedicate) 2)是由于proce...
分类:
其他好文 时间:
2014-06-11 00:17:45
阅读次数:
276
if ((!WriteFile(
m_hDevEx,
pBuf,
size,
&WriteBytes,
&Overlapped)) &&
(GetLastError() != ERROR_IO_PENDING))
{
OutputDebugString("Writ...
分类:
其他好文 时间:
2014-06-10 13:47:45
阅读次数:
149
问题: cannot find -lnlcollect2: error: ld returned 1 exit statusmake: *** [wpa_supplicant] 错误 1解决方法:[fulinux@ubuntu wpa_supplicant]$ sudo apt-get install libnl-dev libssl-dev...
分类:
其他好文 时间:
2014-06-10 13:35:36
阅读次数:
262
1 #include 2 // 主函数main 3 int main() 4 { 5 int
a,b; 6 // 在while循环中以EOF作为文件结束标志 7 // ASCII代码值的范围是0~255,不可能出现-1,因此可以用EOF作为文件结束标志
8 whil...
分类:
其他好文 时间:
2014-06-10 00:42:55
阅读次数:
284