码迷,mamicode.com
首页 >  
搜索关键字:int    ( 143001个结果
最大的最小公倍数 NYOJ 977
1 #include//最大的最小公倍数(977) 2 int main() 3 { 4 long long n,res; 5 while(scanf("%lld",&n)!=EOF){ 6 if(n<3)res=n; 7 else if(n%2)...
分类:其他好文   时间:2015-05-29 08:33:20    阅读次数:129
奇数阶魔方 NYOJ 734
#include//奇数阶魔方(734) int main(){ int a[20][20],i,j,n,x,cnt; scanf("%d",&x); while(x--){ scanf("%d",&n); for(i=0;i<n;i++){ ...
分类:其他好文   时间:2015-05-29 08:32:38    阅读次数:105
最大素因子 NYOJ 520
1 #include//最大素因子(520) 2 #define MAX 1000005 3 int a[MAX]; 4 void f() 5 { 6 int t=0,i,j; 7 for(i=2;i<MAX;i++){ 8 if(a[i]==0)...
分类:其他好文   时间:2015-05-29 08:31:41    阅读次数:146
光棍节的快乐 NYOJ 451
#include//光棍节的快乐(451) long long f(int x){ long long res=1,i; for(i=1;i<=x;i++){ res=res*i; } return res;}long long g(int x){ if(...
分类:其他好文   时间:2015-05-29 08:31:20    阅读次数:133
119 Pascal's Triangle
public class Solution { public ArrayList getRow(int rowIndex) { ArrayList res = new ArrayList(); if (rowIndex = 0; j--) { ...
分类:其他好文   时间:2015-05-29 07:30:39    阅读次数:158
Palindrome Number
Palindrome NumberDetermine whether an integer is a palindrome. Do this without extra space.public class Solution { public boolean isPalindrome(int ...
分类:其他好文   时间:2015-05-29 07:26:14    阅读次数:136
Xfire实现webservice时,对象传递规则及解析简析
Xfire实现webservice,传递对象解析的话,要分两种情况处理:1、基本类型对象;2、复杂对象其实,在客户端直接传递数组,如String[] int[]等这些无法通过配置具体类型来通知xfire的,都需要封装到一个新的自定义对象中来传递1、基本数据对象包括基本数据类型,还有其常用类Strin...
分类:Web程序   时间:2015-05-29 06:13:49    阅读次数:275
String to Integer (atoi)
极值问题public class Solution { public int myAtoi(String str) { // 要考虑清楚极值问题 if(str==null || str.length()==0) return 0; int i=0, r...
分类:其他好文   时间:2015-05-29 06:13:02    阅读次数:131
ZigZag Conversion
public class Solution { public String convert(String s, int numRows) { // http://www.cnblogs.com/springfor/p/3889414.html // 略无聊,就是斜角...
分类:其他好文   时间:2015-05-29 06:12:55    阅读次数:171
Reverse Integer
这道题不考虑越界问题的话,最粗暴的解法public class Solution { public int reverse(int x) { int rev =0; while(x!=0){ rev =rev*10+x%10; ...
分类:其他好文   时间:2015-05-29 06:09:45    阅读次数:200
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!