herrDeng網內搜尋
自訂搜尋
Ads
訂閱:
張貼留言 (Atom)
熱門文章
-
教育部為提昇全民資安素養與電腦防護能力,本部於101年9月5日至11月5日舉辦「全民資安素養自我評量」活動,請在活動期間內踴躍上網檢測資訊安全素養認知程度,並有機會參與抽獎,詳情請參閱活動網站(網址: https://isafe.moe.edu.tw/event
-
先說明一下這是後知後覺的解答,所謂後知就是股票價格已知存在陣列(清單),當然就要用迴圈練習,雙迴圈暴力解需時O(n**2),當然不用,採python單一迴圈解答「最佳股票的買賣時機#LeetCode 121 Best Time to Buy and Sell Stock」,解...
-
url="https://www.twse.com.tw/exchangeReport/STOCK_DAY?response=json&date=20220330&stockNo=2330"
-
你會用C的算子sizeof?
-
Python C++使用字串find迴圈速解Leetcode 2490 Circular Sentence C++ & Python都有字串的find,用法都類似 split=s.find(' ', split+1)能找到s從index=split+1開...
-
Python CPP heap priority queue速解L eetcode 2530. Maximal Score After Applying K Operations heap/priority queue是重要的資料結構,無論是C++的std::priority_q...
55 則留言:
public class B9833115 {
static long gcd (long x, long y)
{
long r=x%y;
if (r==0)return y;
else
return gcd (y,r);
}
public static void main(String arg[])
{
long x=10000000001L;
long y=100000000002L;
long a=gcd(x,y);
System.out.println(gcd(x,y));
}
}
/**
* @(#)sweet.java
*
*
* @author
* @version 1.00 2010/11/1
*/
public class sweet
{
static long gcd(long x,long y)
{
long r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
static public void main(String gcd[])
{
long x=10^10+1;
long y=10^11+2;
System.out.print("gcd最大公因數:"+gcd(x,y));
}
}
public class david {
static long asd(long x ,long y)
{
long r=x%y;
if (r==0) return y;
else
return asd(y,r);
}
static public void main(String arg[])
{
long x=10000000001L;
long y=100000000002L;
System.out.println(asd(x,y));
public class b9833103 {
static long gcd (long x, long y)
{
long r=x%y;
if (r==0)return y;
else
return gcd (y,r);
}
public static void main(String arg[])
{
long x=10000000001L;
long y=1000000000002L;
long a=gcd(x,y);
System.out.println(gcd(x,y));
}
}
/**
* @(#)jave1101.java
*
*
* @author
* @version 1.00 2010/11/1
*/
public class jave1101 {
static long GCD(long x,long y){
long r=x%y;
if(r==0)
return y;
else
return GCD(y,r);
}
public static void main(String[] args){
System.out.println("考前練習--GCD(10^10+1, 10^11+2)=?\n");
long A=10;
for(int i=0;i<9;i++)
A*=10;
A+=1;
long B=10;
for(int i=0;i<10;i++)
B*=10;
B+=2;
System.out.println("A="+A+".B="+B+"\n");
long Q=GCD(B,A);
System.out.println("\n\t答案--GCD(10^10+1, 10^11+2)="+Q);
}
}
public class b9833107 {
static long gcd (long x, long y)
{
long r=x%y;
if (r==0)return y;
else
return gcd (y,r);
}
public static void main(String arg[])
{
long x=10000000001L;
long y=100000000002L;
long a=gcd(x,y);
System.out.println(gcd(x,y));
}
public class b123 {
static long gcd(long x ,long y)
{
long r = x%y;
if(r==0)return y;
&
nbsp; else
return gcd(y,r);
}
public static void main(String[] args)
{
long x=10000000001L;
long y=100000000002L;
long a=gcd(x,y);
System.out.println(gcd(x,y));
}
}
public class B9833115 {
static long gcd (long x, long y)
{
long r=x%y;
if (r==0)return y;
else
return gcd (y,r);
}
public static void main(String arg[])
{
long x=10000000001L;
long y=100000000002L;
long a=gcd(x,y);
System.out.println(gcd(x,y));
}
}
/**
* @(#)aaa.java
*
*
* @author
* @version 1.00 2010/11/1
*/
public class aaa {
static long gcd (long x,long y)
{
long r = x % y;
if (r==0)return y;
else
return gcd (y,r);
}
public static void main(String[] args)
{
long x=10000000001L;
long y=100000000002L;
long a=gcd(x,y);
System.out.println(gcd(x,y));
}
--------------------Configuration: <Default>--------------------
1
Process completed.
public class a {
static long gcd(long x,long y)
{
long i = x%y;
if(i==0)return y;
else
return gcd(y,i);
}
public static void main(String[] args)
{
long x=10000000001L;
long y=100000000002L;
long a=gcd(x,y);
System.out.println(gcd(x,y));
}
}
--------------------------------------
1
Process completed.
public class GCD {
static long gcd(long x,long y)
{
long r = x % y;
if (r==0) return y;
else
return gcd (y,r);
}
public static void main (String[] args)
{
long x = 10000000001L;
long y = 100000000002L;
long a = gcd(x,y);
System.out.println(gcd(x,y));
}
}
public class GCD {
static long gcd (long x, long y)
{
long r = x % y;
if(r == 0) return y;
else
return gcd(y,r);
}
public static void main (String argv[])
{
long x = 10000000001L ;
long y = 100000000002L;
long a = gcd(x,y);
System.out.println(gcd(x,y));
}
}
public class david {
static long david(long x ,long y)
{
long r=x%y;
if (r==0) return y;
else
return david(y,r);
}
static public void main(String arg[])
{
long x=10000000001L;
long y=100000000002L;
System.out.println(david(x,y));
}
}
public class b9833103 {
static long gcd (long x, long y)
{
long r=x%y;
if (r==0)return y;
else
return gcd (y,r);
}
public static void main(String arg[])
{
long x=10000000001L;
long y=1000000000002L;
long a=gcd(x,y);
System.out.println(gcd(x,y));
}
}
--------------------Configuration: <Default>--------------------
1
Process completed.
--------------------Configuration: --------------------
1
Process completed.
public class ex6
{
static long gcd(long x,long y)
{
long r=x%y;
if(r==0)return y;
else
return gcd(y,r);
}
public static void main(String ggd[])
{
long x=10^10+1L,y=10^11+2L;
System.out.print("gcd:"+gcd(x,y));
}
}
public class GCD {
static long gcd (long x, long y)
{
long r = x % y;
if(r == 0) return y;
else
return gcd(y,r);
}
public static void main (String argv[])
{
long x = 10000000001L ;
long y = 100000000002L;
long a = gcd(x,y);
System.out.println(gcd(x,y));
}
}
public class text {
public static void main(String[] erg) {
long i=10000000001L,j=100000000002L;
System.out.println(i);
System.out.println(j);
System.out.print("GCD:"+gcd(i,j));
}
public static long gcd(long x,long y){
long r=x%y;
if (r==0)
return y;
else return gcd(y,r);
}
}
/**
* @(#)Gc.java
*
*
* @author
* @version 1.00 2010/11/1
*/
public class Gc {
static long gcd(long x,long y)
{
long r=x%y;
if(r==0)return y;
else
return gcd(y,r);
}
public static void main(String [] argv)
{
long x=10000000001L;
long y=100000000002L;
System.out.println(gcd(x,y));}
}
public class EX789 {
static long gcd(long x,long y)
{
long r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
public static void main(String[]args)
{
long x=100000000001L;
long y=1000000000002L;
System.out.println("最大公因數="+gcd(x,y));
}
}
public class b123 {
static long gcd(long x ,long y)
{
long r = x%y;
if(r==0)return y;
else
return gcd(y,r);
}
public static void main(String[] args)
{
long x=10000000001L;
long y=100000000002L;
long a=gcd(x,y);
System.out.println(gcd(x,y));
}
}
public class EX06 {
static long gcd (long x,long y)
{
long r=x%y;
if(r==0)return y;
else
return gcd (y,r);
}
static public void main(String[]args)throws Exception
{
long x=1000000001L;
long y=10000000002L;
System.out.println(gcd(x,y));
}
}
public class GCD {
static long gcd(long x,long y)
{
long r=x%y;
if(r==0)return y;
else
return gcd(y,r);
}
public static void main(String[]args)throws Exception
{
long x=1000000001L;
long y=10000000001L;
System.out.print(gcd(x,y));
}
}
/**
* @(#)sweet.java
*
*
* @author
* @version 1.00 2010/11/1
*/
public class sweet
{
static long gcd(long x,long y)
{
long r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
static public void main(String gcd[])
{
long x=10^10+1;
long y=10^11+2;
System.out.print("gcd"+gcd(x,y));
}
}
public class GCD {
static long gcd(long x,long y)
{
long r = x % y;
if (r==0) return y;
else
return gcd (y,r);
}
public static void main (String[] args)
{
long x = 10000000001L;
long y = 100000000002L;
long a = gcd(x,y);
System.out.println(gcd(x,y));
}
}
public class B9833116 {
static long gcd (long x, long y)
{
long r=x%y;
if (r==0)return y;
else
return gcd (y,r);
}
public static void main(String arg[])
{
long x=10000000001L;
long y=100000000002L;
long a=gcd(x,y);
System.out.println(gcd(x,y));
}
public class ex1 {
static long gcd(long x,long y)
{
long r=x%y;
if(r==0) return y;
else
return gcd(y,r);
}
public static void main (String[] args)throws Exception
{
long x=10000000001L;
long y=100000000002L;
System.out.println(gcd(x,y));
}
}
public class B9833115 {
static long gcd (long x, long y)
{
long r=x%y;
if (r==0)return y;
else
return gcd (y,r);
}
public static void main(String arg[])
{
long x=10000000001L;
long y=100000000002L;
long a=gcd(x,y);
System.out.println(gcd(x,y));
}
}
--------------------Configuration: <Default>--------------------
1
Process completed.
public class EX789 {
static long gcd(long x,long y)
{
long r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
public static void main(String[]args)
{
long x=100000000001L;
long y=1000000000002L;
System.out.println("最大公因數="+gcd(x,y));
}
}
public class B9833118 {
static long gcd(long x,long y) {
long r=x%y;
if (r==0) return y;
else return gcd(y,r);
}
public static void main (String arg[])
{
long x=10000000001L;
long y=100000000002L;
long i=gcd(x,y);
System.out.println(gcd(x,y));
}
}
public class EX1 {
static long gcd (long x,long y)
{
long r=x%y;
if(r==0)return y;
else
return gcd(y,r);
}
public static void main (String[] args)throws Exception
{
long x=10000000001L;
long y=100000000002L;
System.out.println(gcd(x,y));
}
}
public class EX06 {
static long gcd (long x,long y)
{
long r=x%y;
if(r==0)return y;
else
return gcd (y,r);
}
static public void main(String[]args)throws Exception
{
long x=1000000001L;
long y=10000000002L;
System.out.println(gcd(x,y));
}
}
public class B9833089 {
static long gcd(long x,long y)
{
long r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
static public void main(String gcd[])
{
long x=10^10+1,y=10^11+2;
System.out.print("gcd:"+gcd(x,y));
}
/**
* @(#)gcd.java
*
*
* @author
* @version 1.00 2010/11/1
*/
public class gcd
{
static long gcd(long x,long y)
{
long r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
static public void main (String gcd[])
{
long x=10^10+1;
long y=10^11+2;
System.out.printf("gcd是:"+gcd(x,y));
}
}
/**
* @(#)b9833062.java
*
*
* @author
* @version 1.00 2010/11/1
*/
public class b9833062 {static long gcd(long x,long y)
{
long r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
static public void main(String gcd[])
{
long x=10^10+1,y=10^11+2;
System.out.print("gcd:"+gcd(x,y));
}
}
public class B9833068 {
static long gcd(long x,long y)
{
long r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
static public void main(String gcd[])
{
long x=10^10+1,y=10^11+2;
System.out.print("gcd:"+gcd(x,y));
}
public class two {
static long gcd(long x,long y)
{
long r=x%y;
if(r==0) return y;
else
return gcd(y,r);
}
public static void main (String[] avgs)throws Exception
{
long x=10000000001L;
long y=100000000002L;
System.out.println(gcd(x,y));
}
}
public class ex4
{
static long gcd(long x,long y)
{
long r=x%y;
if(r==0)return y;
else
return gcd(y,r);
}
static public void main(String gcd[])
{
long x=10^10,y=10^11;;
System.out.print("gcd:"+gcd(x,y));
}
}
public class EX1 {
static long gcd (long x,long y)
{
long r=x%y;
if(r==0) return y;
else
return gcd(y,r);
}
public static void main (String[] avgs) throws Exception
{
long x=10000000001L;
long y=100000000002L;
System.out.println(gcd(x,y));
}
}
public class B9633018 {
static long gcd(long x,long y) {
long r=x%y;
if (r==0) return y;
else return gcd(y,r);
}
public static void main (String arg[])
{
long x=10000000001L;
long y=100000000002L;
long i=gcd(x,y);
System.out.println(gcd(x,y));
}
}
public class B9633039 {
static long gcd(long x,long y) {
long r=x%y;
if (r==0) return y;
else return gcd(y,r);
}
public static void main (String arg[])
{
long x=10000000001L;
long y=100000000002L;
long i=gcd(x,y);
System.out.println(gcd(x,y));
}
}
public class B9833096 {
static long gcd (long x, long y)
{
long r = x % y;
if(r==0)return y;
else
return gcd (y,r);
}
public static void main(String argv[])
{
long x = 100000000001L;
long y = 1000000000002L;
long a = gcd (x,y);
System.out.println(gcd(x,y));
}
}
public class b9833114 {
static long gcd (long x, long y)
{
long r = x % y;
if(r==0)return y;
else
return gcd (y,r);
}
public static void main(String argv[])
{
long x = 100000000001L;
long y = 1000000000002L;
long a = gcd (x,y);
System.out.println(gcd(x,y));
}
}
public class b9833110 {
static long gcd (long x, long y)
{
long r = x % y;
if(r==0)return y;
else
return gcd (y,r);
}
public static void main(String argv[])
{
long x = 100000000001L;
long y = 1000000000002L;
long a = gcd (x,y);
System.out.println(gcd(x,y));
}
}
public class TEX {
static long gg(long a , long b)
{
long r=a%b ;
if(r==0) return b;
else return gg(b,r);
}
public static void main (String X[])
{
long a=10000000001L;
long b=100000000002L;
long i= gg(a,b);
System.out.println(gg(a,b));
}
}
public class hmgdgdk {
static long min (long x,long y)
{
long r=x%y;
if(r==0) return y;
else
return min(y,r);
}
static public void main(String yo[])
{
long x=10000000001L;
long y=100000000002L;
System.out.println(min(x,y));
}
}
public class EX06 {
static long gcd (long x,long y)
{
long r=x%y;
if(r==0)return y;
else
return gcd (y,r);
}
static public void main(String[]args)throws Exception
{
long x=1000000001L;
long y=10000000002L;
System.out.println(gcd(x,y));
}
}
class gcd
{
static float gcd(float a,float b)
{
float r=a%b;
if(r==0) return b;
else return gcd(b,r);
}
static public void main(String args[])
{
System.out.println(gcd(100000000002l,10000000001l));
}
}
public class B9833073
{
static long gcd(long x,long y)
{
long r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
static public void main(String gcd[])
{
long x=10^10+1,y=10^11+2;
System.out.print("gcd:"+gcd(x,y));
}
}
public class gce {static long gcd(long x,long y)
{
long r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
static public void main(String gcd[])
{
long x=10^10+1;
long y=10^11+2;
System.out.print("gcd:"+gcd(x,y));
}
}
public class b {static int gcd(int x,int y)
{
int r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
static public void main(String gcd[])
{
int x=10^10+1,y=10^11+2;
System.out.print("gcd:"+gcd(x,y));
}
}
public class b {static long gcd(long x,long y)
{
long r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
static public void main(String gcd[])
{
long x=10^10+1,y=10^11+2;
System.out.print("gcd:"+gcd(x,y));
}
}
class gcd
{
static float gcd(float a,float b)
{
float c=a%b;
if(c==0) return b;
else return gcd(b,c);
}
static public void main(String args[])
{
System.out.println(gcd(10000000001l,100000000002l));
}
}
public class B9833062 {
public static void main(String arg[])
{
long f[] = new long [51];
f[0]= f[1]= 1;
for (int n=2;n<51;n++)
{
f[n]=f[n-1]+f[n-2];
System.out.println(n+"->"+f[n]);
}
}
}
張貼留言