计算最长连续相同字符的个数
测试数据
输入:
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
非常巧妙的题目,巧用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
一、JDBC编程
1. 使用JDBC规范
在数据库编程方面,最先使用的数据持久化技术无疑是JDBC
可以说JDBC(Java Data Base Connectivity)是学习其它数据持久化技术的基础
Java中访问数据库使用的就是JDBC,基本操作有CRUD(Create-Read-Update-Delete)...
分类:
其他好文 时间:
2014-06-11 00:38:19
阅读次数:
336
JavaScript 是一种解释性的基于对象的脚本语言。 JavaScript 语言使用的语法与 C
语言使用的语法类似,并支持结构化构造,例如if...else、for和do...while。大括号 ({})
用于分隔语句块。该语言支持各种数据类型,包括String、Number、Boole...
分类:
编程语言 时间:
2014-06-10 08:50:04
阅读次数:
284
Givennpoints on a 2D plane, find the maximum
number of points that lie on the same straight
line.每次固定一个点,然后遍历所有其它点,记录每种斜率出现的次数。需要考虑两种特殊情况:斜率不存在和点与固定点重...
分类:
其他好文 时间:
2014-06-10 08:44:57
阅读次数:
164
作为前端开发人员,在日常的页面制作时,不可避免的会碰上这样那样的问题,我挑选了其中的一些进行总结归档,希望对大家会有所帮助:1、如何定义高度很小的容器?
在IE6下无法定义小高度的容器,是因为有一个默认的行高。列举2种解决方案:overflow:hidden | line-height:02、图片下...
分类:
Web程序 时间:
2014-06-10 08:39:03
阅读次数:
314
通过多线程或多进程可以减弱阻塞IO的负面作用。/* For sockaddr_in
*/#include /* For socket functions */#include #include #include #include
#include #define MAX_LINE 16384char...
分类:
编程语言 时间:
2014-06-10 08:36:26
阅读次数:
290
I/O 1.文件操作:File(1)voidAppendAllText(string
path, string contents)(2)boolExists(string path)(3)string[]Read...
分类:
其他好文 时间:
2014-06-10 00:58:28
阅读次数:
535
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
There areNchildren standing in a line. Each
child is assigned a rating value.You are giving candies to these children
subjected to the following requi...
分类:
其他好文 时间:
2014-06-10 00:35:47
阅读次数:
246