码迷,mamicode.com
首页 >  
搜索关键字:string    ( 95377个结果)
java:50瓶可乐,每喝三瓶给你一瓶,请问最后喝了多少瓶.
package jihuoma; //50瓶可乐,每喝三瓶给你一瓶,请问最后喝了多少瓶. public class Test1 { public static void main(String[] args) { int count=50;//统计喝了多少瓶,初值50瓶 int sum=50;//初值50瓶可乐 while(true) { sum=sum-3;//喝三瓶后送...
分类:编程语言   时间:2015-01-13 21:44:12    阅读次数:422
冒泡排序
冒泡排序 1 public static void main(String[] args) { 2 int[] nums = {1,2,88,7,1,20,30,18,92}; 3 int temp = 0; 4 int N = nums.length...
分类:编程语言   时间:2015-01-13 21:21:59    阅读次数:135
xliff标签
1)标签的id属性可以随便命名,不给id也没关系;2) 使用标签的string.xml文件的标签必须声明命名空间xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2",否则报错;3)标签里的格式是%x$yz.其中:%,$符号的位置是固定的,x表示占位符...
分类:其他好文   时间:2015-01-13 21:21:34    阅读次数:228
strcmp()比较函数和strcasecmp()和strnatcmp()
strcmp()的函数原型如下()int strcmp(string str1,string str2) 该函数需要两个进行比较的参数字符串,如果这两个字符串相等,该函数就返回0,如果按字典顺序str1在str2后面(大于str2)就返回一个正数,否则,就返回一个负数,这个函数是区分大小写的。 函数...
分类:其他好文   时间:2015-01-13 21:16:26    阅读次数:208
[LeetCode][Python]ZigZag Conversion
# -*- coding: utf8 -*-'''__author__ = 'dabay.wang@gmail.com'https://oj.leetcode.com/problems/zigzag-conversion/The string "PAYPALISHIRING" is written ...
分类:编程语言   时间:2015-01-13 21:10:46    阅读次数:416
Java-Compare Version Numbers
Compare two version numbers version1 and version1. If version1 > version2 return 1, if version1  version2 return -1, otherwise return 0. You may assume that the version strings are non-empty and c...
分类:编程语言   时间:2015-01-13 20:00:14    阅读次数:190
leetcode6 Zigzag Conversion
题目要求: The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) P A H N A...
分类:其他好文   时间:2015-01-13 19:57:52    阅读次数:141
利用随机数生成方法产生激活码,形如12HJ-9Hjf-HHTY-KK8G
产生一个激活码 package jihuoma; //产生激活码:类似于2Hs0-ssKj-9HHo-A55D public class Test { public static void main(String[] args) { String str=""; for (int i = 1; i <= 16; i++) { int a=(int)(Math.random()*3...
分类:其他好文   时间:2015-01-13 19:50:58    阅读次数:157
假设有50瓶饮料,喝完3个空瓶可以换一瓶饮料,依次类推,请问总共喝了多少瓶饮料?
这大家可以这么想 一共有50瓶, 喝完三瓶 + 1 喝完三瓶 + 1 那么 50 - 3 + 1 -3 + 1 以此类推知道。。。最后剩余的可乐数小于3退出。那么依旧题意可以写出。 package cccc; public class Buy { public static void main(String[] args) { int number = 50;         /...
分类:其他好文   时间:2015-01-13 19:50:47    阅读次数:795
Hibernate 多对多关联Demo
以学生[Student ]与课程[Course ]之间的关系为例:1 //Course .java2 3 public class Course implements Serializable {4 private long cid;5 private String cname;6 ...
分类:Web程序   时间:2015-01-13 19:45:04    阅读次数:220
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!