herrDeng網內搜尋
自訂搜尋
Ads
2009年6月2日 星期二
訂閱:
張貼留言 (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...
61 則留言:
C:\Documents and Settings\user\桌面>type 1.cpp
#include <stdio.h>
#include <stdlib.h>
int gcd(int x,int y)
{
int r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
int main(int argc,char *argv[])
{
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>1 88 55
3
11
C:\Documents and Settings\user\桌面>type 2.cpp
#include <stdio.h>
#include <stdlib.h>
int gcd(int x,int y)
{
int r=x%y;
if (r==0)
return y;
else
return gcd(y,r);
}
int main(int argc,char *argv[]){
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("Pause");
return 0;
}
C:\Documents and Settings\user\桌面>2 12 36
3
gcd=12
Microsoft Windows XP [版本 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type work.cpp
#include <stdio.h>
#include <stdlib.h>
int gcd(int x, int y)
{
int r=x%y;
if (r==0)
return y;
else
return gcd(y,r);
}
int main(int argc, char *argv[]){
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>work 36 78
3
gcd=6
C:\Documents and Settings\user\桌面>type 1.cpp
#include <stdio.h>
#include <stdlib.h>
int gcd(int x,int y)
{
int r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
int main(int argc,char *argv[])
{
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>1 132 110
3
gcd=22
請按任意鍵繼續 . . .
Microsoft Windows XP [版本 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type 123.cpp
#include <stdio.h>
#include <stdlib.h>
int gcd(int x, int y)
{
int r=x%y;
if (r==0)
return y;
else
return gcd(y,r);
}
int main(int argc, char *argv[]){
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>123 23 45
3
gcd=1
請按任意鍵繼續 . . .
Microsoft Windows XP [版本 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type 123.cpp
#include <stdio.h>
#include <stdlib.h>
int gcd(int x, int y)
{
int r=x%y;
if (r==0)
return y;
else
return gcd(y,r);
}
int main(int argc, char *argv[]){
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>123 12 34
3
gcd=2
請按任意鍵繼續 . . .
Microsoft Windows XP [版本 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type 123.cpp
#include <stdio.h>
#include <stdlib.h>
int gcd(int x, int y)
{
int r=x%y;
if (r==0)
return y;
else
return gcd(y,r);
}
int main(int argc, char *argv[]){
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>123 12 34
3
gcd=2
請按任意鍵繼續 . . .
C:\Documents and Settings\user\桌面>type 123456.cpp
#include <stdio.h>
#include <stdlib.h>
int gcd(int,int);
int main(int argc,char *argv[]){
int n=argc;
printf("%d\n",n);
int x=atoi (argv[1]);
int y=atoi (argv[2]);
printf("%d\n",x+y);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
int gcd(int x,int y)
{
int ans;
if(x%y==0)
{
ans=y;
}
else
{
ans=gcd(y,x%y);
}
return ans;
}
C:\Documents and Settings\user\桌面>test 1234 1234
3
2468
請按任意鍵繼續 . . .
C:\Documents and Settings\user\桌面>123456 1234 1234
3
2468
gcd=1234
請按任意鍵繼續 . . .
C:\Documents and Settings\user\桌面>type gcd.cpp
#include <stdio.h>
#include <stdlib.h>
int gcd(int,int);
int main(int argc,char *argv[]){
int n=argc;
printf("%d\n",n);
int x=atoi (argv[1]);
int y=atoi (argv[2]);
printf("%d\n",x+y);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
int gcd(int x,int y)
{
int ans;
if(x%y==0)
{
ans=y;
}
else
{
ans=gcd(y,x%y);
}
return ans;
}
C:\Documents and Settings\user\桌面>gcd 1234 1234
3
2468
gcd=1234
請按任意鍵繼續 . . .
C:\Documents and Settings\user\桌面>type gcd.cpp
#include <stdio.h>
#include <stdlib.h>
int gcd(int,int);
int main(int argc,char *argv[]){
int n=argc;
printf("%d\n",n);
int x=atoi (argv[1]);
int y=atoi (argv[2]);
printf("%d\n",x+y);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
int gcd(int x,int y)
{
int ans;
if(x%y==0)
{
ans=y;
}
else
{
ans=gcd(y,x%y);
}
return ans;
}
C:\Documents and Settings\user\桌面>gcd 1234 1234
3
2468
gcd=1234
請按任意鍵繼續 . . .
C:\Documents and Settings\user\桌面>type gcd.cpp
#include <stdio.h>
#include <stdlib.h>
int gcd(int,int);
int main(int argc,char *argv[]){
int n=argc;
printf("%d\n",n);
int x=atoi (argv[1]);
int y=atoi (argv[2]);
printf("%d\n",x+y);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
int gcd(int x,int y)
{
int ans;
if(x%y==0)
{
ans=y;
}
else
{
ans=gcd(y,x%y);
}
return ans;
}
C:\Documents and Settings\user\桌面>gcd 1234 1234
3
2468
gcd=1234
請按任意鍵繼續 . . .
Microsoft Windows XP [版本 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>dir/w
磁碟區 C 中的磁碟是 Win XP
磁碟區序號: F809-3433
C:\Documents and Settings\user\桌面 的目錄
[.] [..]
Dev-C++.lnk ITE測驗系統-Client端程式.lnk
Makefile.win Microsoft Visual Studio 2008.lnk
PhotoImpact 10.lnk PowerCam5.lnk
SPSS 14.0 中文視窗版.lnk SQL Server Management Studio.lnk
[src] test.cpp
test.dev test.exe
test.o TQC測驗系統-Client端程式.lnk
Wireshark.lnk WorkFlowERP 系統.lnk
網際網路.lnk
16 個檔案 442,180 位元組
3 個目錄 8,810,323,968 位元組可用
C:\Documents and Settings\user\桌面>type test.cpp
#include <cstdlib>
#include <iostream>
using namespace std;
int gcd(int,int);
int main(int argc, char *argv[])
{
int m=atoi(argv[1]);
int n=atoi(argv[2]);
printf("gcd=%d\n",gcd(m,n));
system("PAUSE");
return EXIT_SUCCESS;
}
int gcd(int m,int n)
{
int ans;
if(m%n==0)
{
ans=n;
}
else
{
ans=gcd(n,m%n);
}
return ans;
}
C:\Documents and Settings\user\桌面>test 123 456
gcd=3
Microsoft Windows XP [版本 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>dir/w
磁碟區 C 中的磁碟是 Win XP
磁碟區序號: F809-3433
C:\Documents and Settings\user\桌面 的目錄
[.] [..]
Dev-C++.lnk ITE測驗系統-Client端程式.lnk
Makefile.win Microsoft Visual Studio 2008.lnk
PhotoImpact 10.lnk PowerCam5.lnk
SPSS 14.0 中文視窗版.lnk SQL Server Management Studio.lnk
[src] test.cpp
test.dev test.exe
test.o TQC測驗系統-Client端程式.lnk
Wireshark.lnk WorkFlowERP 系統.lnk
網際網路.lnk
16 個檔案 442,180 位元組
3 個目錄 8,808,656,896 位元組可用
C:\Documents and Settings\user\桌面>type test.cpp
#include <cstdlib>
#include <iostream>
using namespace std;
int gcd(int,int);
int main(int argc, char *argv[])
{
int m=atoi(argv[1]);
int n=atoi(argv[2]);
printf("gcd=%d\n",gcd(m,n));
system("PAUSE");
return EXIT_SUCCESS;
}
int gcd(int m,int n)
{
int ans;
if(m%n==0)
{
ans=n;
}
else
{
ans=gcd(n,m%n);
}
return ans;
}
C:\Documents and Settings\user\桌面>test 125 15
gcd=5
C:\Documents and Settings\user\桌面>type 1.cpp
#include <stdio.h>
#include <stdlib.h>
int gcd(int x,int y)
{
int r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
int main(int argc,char *argv[])
{
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>1 2345 6789
3
gcd=1
請按任意鍵繼續 . . .
Microsoft Windows XP [版本 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>dir/w
磁碟區 C 中的磁碟是 Win XP
磁碟區序號: F809-3433
C:\Documents and Settings\user\桌面 的目錄
[.] [..]
Dev-C++.lnk ITE測驗系統-Client端程式.lnk
Makefile.win Microsoft Visual Studio 2008.lnk
PhotoImpact 10.lnk PowerCam5.lnk
SPSS 14.0 中文視窗版.lnk SQL Server Management Studio.lnk
[src] test.cpp
test.dev test.exe
test.o TQC測驗系統-Client端程式.lnk
Wireshark.lnk WorkFlowERP 系統.lnk
網際網路.lnk
16 個檔案 442,180 位元組
3 個目錄 8,808,529,920 位元組可用
C:\Documents and Settings\user\桌面>type test.cpp
#include <cstdlib>
#include <iostream>
using namespace std;
int gcd(int,int);
int main(int argc, char *argv[])
{
int m=atoi(argv[1]);
int n=atoi(argv[2]);
printf("gcd=%d\n",gcd(m,n));
system("PAUSE");
return EXIT_SUCCESS;
}
int gcd(int m,int n)
{
int ans;
if(m%n==0)
{
ans=n;
}
else
{
ans=gcd(n,m%n);
}
return ans;
}
C:\Documents and Settings\user\桌面>test 9887 8654
gcd=1
C:\Documents and Settings\user\桌面>type 1.cpp
#include <stdio.h>
#include <stdlib.h>
int gcd(int x,int y)
{
int r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
int main(int argc,char *argv[])
{
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>1 2345 6789
3
gcd=1
請按任意鍵繼續 . . .
Microsoft Windows XP [版本 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>dir/w
磁碟區 C 中的磁碟是 Win XP
磁碟區序號: F809-3433
C:\Documents and Settings\user\桌面 的目錄
[.] [..]
Dev-C++.lnk ITE測驗系統-Client端程式.lnk
Makefile.win Microsoft Visual Studio 2008.lnk
PhotoImpact 10.lnk PowerCam5.lnk
SPSS 14.0 中文視窗版.lnk SQL Server Management Studio.lnk
[src] test.cpp
test.dev test.exe
test.o TQC測驗系統-Client端程式.lnk
Wireshark.lnk WorkFlowERP 系統.lnk
網際網路.lnk
16 個檔案 442,180 位元組
3 個目錄 8,808,529,920 位元組可用
C:\Documents and Settings\user\桌面>type test.cpp
#include <cstdlib>
#include <iostream>
using namespace std;
int gcd(int,int);
int main(int argc, char *argv[])
{
int m=atoi(argv[1]);
int n=atoi(argv[2]);
printf("gcd=%d\n",gcd(m,n));
system("PAUSE");
return EXIT_SUCCESS;
}
int gcd(int m,int n)
{
int ans;
if(m%n==0)
{
ans=n;
}
else
{
ans=gcd(n,m%n);
}
return ans;
}
C:\Documents and Settings\user\桌面>test 9887 8654
gcd=1
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type 123.cpp
#include<stdio.h>
#include<stdlib.h>
int gcd(int x,int y)
{
int r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
int main(int argc,char*argv[])
{
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>123 1000 1004
3
gcd=4
請按任意鍵繼續 . . .
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type 123.cpp
#include<stdio.h>
#include<stdlib.h>
int gcd(int x,int y)
{
int r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
int main(int argc,char*argv[])
{
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>123 1000 1004
3
gcd=4
請按任意鍵繼續 . . .
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type 123.cpp
#include<stdio.h>
#include<stdlib.h>
int gcd(int x,int y)
{
int r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
int main(int argc,char*argv[])
{
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>123 1000 1004
3
gcd=4
請按任意鍵繼續 . . .
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type 123.cpp
#include<stdio.h>
#include<stdlib.h>
int gcd(int x,int y)
{
int r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
int main(int argc,char*argv[])
{
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>123 1000 1004
3
gcd=4
請按任意鍵繼續 . . .
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type 123.cpp
#include<stdio.h>
#include<stdlib.h>
int gcd(int x,int y)
{
int r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
int main(int argc,char*argv[])
{
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>123 1000 1004
3
gcd=4
請按任意鍵繼續 . . .
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type 123.cpp
#include<stdio.h>
#include<stdlib.h>
int gcd(int x,int y)
{
int r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
int main(int argc,char*argv[])
{
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>123 1000 1004
3
gcd=4
請按任意鍵繼續 . . .
Microsoft Windows XP [版本 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>dir/w
磁碟區 C 中的磁碟是 Win XP
磁碟區序號: F809-3433
C:\Documents and Settings\user\桌面 的目錄
[.] [..]
Dev-C++.lnk ITE測驗系統-Client端程式.lnk
Makefile.win Microsoft Visual Studio 2008.lnk
PhotoImpact 10.lnk PowerCam5.lnk
SPSS 14.0 中文視窗版.lnk SQL Server Management Studio.lnk
[src] test.cpp
test.dev test.exe
test.o TQC測驗系統-Client端程式.lnk
Wireshark.lnk WorkFlowERP 系統.lnk
網際網路.lnk
16 個檔案 442,180 位元組
3 個目錄 8,808,529,920 位元組可用
C:\Documents and Settings\user\桌面>type test.cpp
#include <cstdlib>
#include <iostream>
using namespace std;
int gcd(int,int);
int main(int argc, char *argv[])
{
int m=atoi(argv[1]);
int n=atoi(argv[2]);
printf("gcd=%d\n",gcd(m,n));
system("PAUSE");
return EXIT_SUCCESS;
}
int gcd(int m,int n)
{
int ans;
if(m%n==0)
{
ans=n;
}
else
{
ans=gcd(n,m%n);
}
return ans;
}
C:\Documents and Settings\user\桌面>test 9887 8654
gcd=1
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type 123.cpp
#include<stdio.h>
#include<stdlib.h>
int gcd(int x,int y)
{
int r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
int main(int argc,char*argv[])
{
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>123 1000 1004
3
gcd=4
請按任意鍵繼續 . . .
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type 123.cpp
#include<stdio.h>
#include<stdlib.h>
int gcd(int x,int y)
{
int r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
int main(int argc,char*argv[])
{
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>123 1000 1004
3
gcd=4
請按任意鍵繼續 . . .
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type 123.cpp
#include<stdio.h>
#include<stdlib.h>
int gcd(int x,int y)
{
int r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
int main(int argc,char*argv[])
{
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>123 1000 1004
3
gcd=4
請按任意鍵繼續 . . .
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type 123.cpp
#include<stdio.h>
#include<stdlib.h>
int gcd(int x,int y)
{
int r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
int main(int argc,char*argv[])
{
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>123 1000 1004
3
gcd=4
請按任意鍵繼續 . . .
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type 123.cpp
#include<stdio.h>
#include<stdlib.h>
int gcd(int x,int y)
{
int r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
int main(int argc,char*argv[])
{
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>123 1000 1004
3
gcd=4
請按任意鍵繼續 . . .
Microsoft Windows XP [版本 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>dir/w
磁碟區 C 中的磁碟是 Win XP
磁碟區序號: F809-3433
C:\Documents and Settings\user\桌面 的目錄
[.] [..]
Dev-C++.lnk ITE測驗系統-Client端程式.lnk
Makefile.win Microsoft Visual Studio 2008.lnk
PhotoImpact 10.lnk PowerCam5.lnk
SPSS 14.0 中文視窗版.lnk SQL Server Management Studio.lnk
[src] test.cpp
test.dev test.exe
test.o test.sln
TQC測驗系統-Client端程式.lnk Wireshark.lnk
WorkFlowERP 系統.lnk 網際網路.lnk
17 個檔案 442,380 位元組
3 個目錄 8,808,882,176 位元組可用
C:\Documents and Settings\user\桌面>type test.cpp
#include <cstdlib>
#include <iostream>
using namespace std;
int gcd(int,int);
int main(int argc, char *argv[])
{
int m=atoi(argv[1]);
int n=atoi(argv[2]);
printf("gcd=%d\n",gcd(m,n));
system("PAUSE");
return EXIT_SUCCESS;
}
int gcd(int m,int n)
{
int ans;
if(m%n==0)
{
ans=n;
}
else
{
ans=gcd(n,m%n);
}
return ans;
}
C:\Documents and Settings\user\桌面>test 10 20
gcd=10
請按任意鍵繼續 . . .
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type 123.cpp
#include<stdio.h>
#include<stdlib.h>
int gcd(int x,int y)
{
int r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
int main(int argc,char*argv[])
{
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>123 1000 1004
3
gcd=4
請按任意鍵繼續 . . .
#include <cstdlib>
#include <iostream>
using namespace std;
int gcd(int,int);
int main(int argc, char *argv[])
{
int m=atoi(argv[1]);
int n=atoi(argv[2]);
printf("gcd=%d\n",gcd(m,n));
system("PAUSE");
return EXIT_SUCCESS;
}
int gcd(int m,int n)
{
int ans;
if(m%n==0)
{
ans=n;
}
else
{
ans=gcd(n,m%n);
}
return ans;
}
Microsoft Windows XP [版本 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type 新文件1.cpp
#include<stdio.h>
#include<stdlib.h>
int gcd(int x, int y)
{
int r=x%y;
if (r==0)
return y;
else
return gcd(y,r);
}
int main(int argc, char *argv[]){
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>新文件1 123 456
3
gcd=3
請按任意鍵繼續 . . .
Microsoft Windows XP [版本 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>dir/w
磁碟區 C 中的磁碟是 Win XP
磁碟區序號: F809-3433
C:\Documents and Settings\user\桌面 的目錄
[.] [..]
Dev-C++.lnk ITE測驗系統-Client端程式.lnk
Makefile.win Microsoft Visual Studio 2008.lnk
PhotoImpact 10.lnk PowerCam5.lnk
SPSS 14.0 中文視窗版.lnk SQL Server Management Studio.lnk
[src] test.cpp
test.dev test.exe
test.o test.sln
TQC測驗系統-Client端程式.lnk Wireshark.lnk
WorkFlowERP 系統.lnk 網際網路.lnk
17 個檔案 442,380 位元組
3 個目錄 8,808,882,176 位元組可用
C:\Documents and Settings\user\桌面>type test.cpp
#include <cstdlib>
#include <iostream>
using namespace std;
int gcd(int,int);
int main(int argc, char *argv[])
{
int m=atoi(argv[1]);
int n=atoi(argv[2]);
printf("gcd=%d\n",gcd(m,n));
system("PAUSE");
return EXIT_SUCCESS;
}
int gcd(int m,int n)
{
int ans;
if(m%n==0)
{
ans=n;
}
else
{
ans=gcd(n,m%n);
}
return ans;
}
C:\Documents and Settings\user\桌面>test 123 456
gcd=3
請按任意鍵繼續 . . .
Microsoft Windows XP [版本 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type 測試.cpp
#include<stdio.h>
#include<stdlib.h>
int gcd(int x, int y)
{
int r=x%y;
if (r==0)
return y;
else
return gcd(y,r);
}
int main(int argc, char *argv[]){
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>測試 123 456
3
gcd=3
請按任意鍵繼續 . . .
#include <cstdlib>
#include <iostream>
using namespace std;
int gcd(int,int);
int main(int argc, char *argv[])
{
int m=atoi(argv[1]);
int n=atoi(argv[2]);
printf ("gcd=%d\n",gcd(m,n));
system ("pause");
return EXIT_SUCCESS;
}
int gcd(int m,int n)
{
int ans;
if(m%n==0)
{
ans=n;
}
else
{
ans=gcd(n,m%n);
}
return ans;
}
Microsoft Windows XP [版本 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type test.cpp
#include<stdio.h>
#include<stdlib.h>
int gcd(int x, int y)
{
int r=x%y;
if (r==0)
return y;
else
return gcd(y,r);
}
int main(int argc, char *argv[]){
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>test 123 456
3
gcd=3
請按任意鍵繼續 . . .
Microsoft Windows XP [版本 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type 123.cpp
#include<stdio.h>
#include<stdlib.h>
int gcd(int x, int y)
{
int r=x%y;
if (r==0)
return y;
else
return gcd(y,r);
}
int main(int argc, char *argv[]){
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>123 123 456
3
gcd=3
請按任意鍵繼續 . . .
Microsoft Windows XP [版本 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type 新文件1.cpp
#include<stdio.h>
#include<stdlib.h>
int gcd(int x, int y)
{
int r=x%y;
if (r==0)
return y;
else
return gcd(y,r);
}
int main(int argc, char *argv[]){
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>新文件1 123 456
3
gcd=3
請按任意鍵繼續 . . .
Microsoft Windows XP [版本 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type 新文件1.cpp
#include<stdio.h>
#include<stdlib.h>
int gcd(int x, int y)
{
int r=x%y;
if (r==0)
return y;
else
return gcd(y,r);
}
int main(int argc, char *argv[]){
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>新文件1 123 456
3
gcd=3
請按任意鍵繼續 . . .
Microsoft Windows XP [版本 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type 新文件2.cpp
#include<stdio.h>
#include<stdlib.h>
int gcd(int x, int y)
{
int r=x%y;
if (r==0)
return y;
else
return gcd(y,r);
}
int main(int argc, char *argv[]){
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>新文件2 123 456
3
gcd=3
請按任意鍵繼續 . . .
Microsoft Windows XP [版本 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type 新文件2.cpp
#include<stdio.h>
#include<stdlib.h>
int gcd(int x, int y)
{
int r=x%y;
if (r==0)
return y;
else
return gcd(y,r);
}
int main(int argc, char *argv[]){
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>新文件2 123 456
3
gcd=3
請按任意鍵繼續 . . .
Microsoft Windows XP [版本 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\user>dir/w
磁碟區 C 中的磁碟是 Win XP
磁碟區序號: F809-3433
C:\Documents and Settings\user 的目錄
[.] [..] [Favorites] [My Documents]
[WINDOWS] [「開始」功能表] [桌面]
0 個檔案 0 位元組
7 個目錄 8,907,120,640 位元組可用
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type test.cpp
#include<stdio.h>
#include<stdlib.h>
int gcd(int x,int y)
{
int r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
int main(int argc,char*argv[])
{
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>test 1234 1238
3
gcd=2
請按任意鍵繼續 . . .
C:\Documents and Settings\user\桌面>
#include <stdio.h>
#include <stdlib.h>
int gcd(int x,int y)
{
int ans;
if(x%y==0)
{
ans=y;
}
else
{
ans=gcd(y,x%y);
}
return ans;
}
int main(int arge,char *argv[]){
int n=arge;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("%d\n",x+y);
printf ("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>type main.cpp
#include <stdio.h>
#include <stdlib.h>
int gcd(int x,int y)
{
int ans;
if(x%y==0)
{
ans=y;
}
else
{
ans=gcd(y,x%y);
}
return ans;
}
int main(int arge,char *argv[]){
int n=arge;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("%d\n",x+y);
printf ("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>專案1 987654321 123456789
3
1111111110
gcd=9
請按任意鍵繼續 . . .
Microsoft Windows XP [版本 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\user>dir/w
磁碟區 C 中的磁碟是 Win XP
磁碟區序號: F809-3433
C:\Documents and Settings\user 的目錄
[.] [..] [Favorites] [My Documents]
[WINDOWS] [「開始」功能表] [桌面]
0 個檔案 0 位元組
7 個目錄 8,907,120,640 位元組可用
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type test.cpp
#include<stdio.h>
#include<stdlib.h>
int gcd(int x,int y)
{
int r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
int main(int argc,char*argv[])
{
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>test 1234 1238
3
gcd=2
請按任意鍵繼續 . . .
C:\Documents and Settings\user\桌面>
Microsoft Windows XP [版本 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type 新文件1.cpp
#include<stdio.h>
#include<stdlib.h>
int gcd(int x, int y)
{
int r=x%y;
if (r==0)
return y;
else
return gcd(y,r);
}
int main(int argc, char *argv[]){
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>新文件1 123 456
3
gcd=3
請按任意鍵繼續 . . .
Microsoft Windows XP [版本 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type 新文件1.cpp
#include<stdio.h>
#include<stdlib.h>
int gcd(int x, int y)
{
int r=x%y;
if (r==0)
return y;
else
return gcd(y,r);
}
int main(int argc, char *argv[]){
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>新文件1 123 456
3
gcd=3
請按任意鍵繼續 . . .
C:\Documents and Settings\user>dir/w
磁碟區 C 中的磁碟是 Win XP
磁碟區序號: F809-3433
C:\Documents and Settings\user 的目錄
[.] [..] [Favorites] [My Documents]
[WINDOWS] [「開始」功能表] [桌面]
0 個檔案 0 位元組
7 個目錄 8,905,940,992 位元組可用
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type test.cpp
#include<stdio.h>
#include<stdlib.h>
int gcd(int x,int y)
{
int r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
int main(int argc,char*argv[])
{
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>test 1235 1236
3
gcd=1
請按任意鍵繼續 . . .
Microsoft Windows XP [版本 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type 新文件1.cpp
#include<stdio.h>
#include<stdlib.h>
int gcd(int x, int y)
{
int r=x%y;
if (r==0)
return y;
else
return gcd(y,r);
}
int main(int argc, char *argv[]){
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>新文件1 123 456
3
gcd=3
請按任意鍵繼續 . . .
Microsoft Windows XP [版本 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\user>dir/w
磁碟區 C 中的磁碟是 Win XP
磁碟區序號: F809-3433
C:\Documents and Settings\user 的目錄
[.] [..] [Favorites] [My Documents]
[WINDOWS] [「開始」功能表] [桌面]
0 個檔案 0 位元組
7 個目錄 8,813,068,288 位元組可用
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type test.cpp
#include<stdio.h>
#include<stdlib.h>
int gcd(int x,int y)
{
int r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
int main(int argc,char*argv[])
{
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>test 120 110
3
gcd=10
請按任意鍵繼續 . . .
Microsoft Windows XP [版本 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type 新文件1.cpp
#include<stdio.h>
#include<stdlib.h>
int gcd(int x, int y)
{
int r=x%y;
if (r==0)
return y;
else
return gcd(y,r);
}
int main(int argc, char *argv[]){
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>新文件1 123 456
3
gcd=3
請按任意鍵繼續 . . .
Microsoft Windows XP [版本 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type 新文件1.cpp
#include<stdio.h>
#include<stdlib.h>
int gcd(int x, int y)
{
int r=x%y;
if (r==0)
return y;
else
return gcd(y,r);
}
int main(int argc, char *argv[]){
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>新文件1 123 456
3
gcd=3
請按任意鍵繼續 . . .
Microsoft Windows XP [版本 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>dir/w
磁碟區 C 中的磁碟是 Win XP
磁碟區序號: F809-3433
C:\Documents and Settings\user\桌面 的目錄
[.] [..]
Dev-C++.lnk ITE測驗系統-Client端程式.lnk
Makefile.win Microsoft Visual Studio 2008.lnk
PhotoImpact 10.lnk PowerCam5.lnk
SPSS 14.0 中文視窗版.lnk SQL Server Management Studio.lnk
[src] test.cpp
test.dev test.exe
test.o test.sln
TQC測驗系統-Client端程式.lnk Wireshark.lnk
WorkFlowERP 系統.lnk 網際網路.lnk
17 個檔案 442,380 位元組
3 個目錄 8,808,882,176 位元組可用
C:\Documents and Settings\user\桌面>type test.cpp
#include <cstdlib>
#include <iostream>
using namespace std;
int gcd(int,int);
int main(int argc, char *argv[])
{
int m=atoi(argv[1]);
int n=atoi(argv[2]);
printf("gcd=%d\n",gcd(m,n));
system("PAUSE");
return EXIT_SUCCESS;
}
int gcd(int m,int n)
{
int ans;
if(m%n==0)
{
ans=n;
}
else
{
ans=gcd(n,m%n);
}
return ans;
}
C:\Documents and Settings\user\桌面>test 123 456
gcd=3
請按任意鍵繼續 . . .
C:\Documents and Settings\user>dir/w
磁碟區 C 中的磁碟是 Win XP
磁碟區序號: F809-3433
C:\Documents and Settings\user 的目錄
[.] [..] [Favorites] [My Documents]
[WINDOWS] [「開始」功能表] [桌面]
0 個檔案 0 位元組
7 個目錄 8,905,940,992 位元組可用
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type test.cpp
#include<stdio.h>
#include<stdlib.h>
int gcd(int x,int y)
{
int r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
int main(int argc,char*argv[])
{
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>test 1235 1236
3
gcd=1
請按任意鍵繼續 . . .
C:\Documents and Settings\user>dir/w
磁碟區 C 中的磁碟是 Win XP
磁碟區序號: F809-3433
C:\Documents and Settings\user 的目錄
[.] [..] [Favorites] [My Documents]
[WINDOWS] [「開始」功能表] [桌面]
0 個檔案 0 位元組
7 個目錄 8,905,940,992 位元組可用
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type test.cpp
#include<stdio.h>
#include<stdlib.h>
int gcd(int x,int y)
{
int r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
int main(int argc,char*argv[])
{
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>test 1235 1236
3
gcd=1
請按任意鍵繼續 . . .
C:\Documents and Settings\user>dir/w
磁碟區 C 中的磁碟是 Win XP
磁碟區序號: F809-3433
C:\Documents and Settings\user 的目錄
[.] [..] [Favorites] [My Documents]
[WINDOWS] [「開始」功能表] [桌面]
0 個檔案 0 位元組
7 個目錄 8,905,940,992 位元組可用
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type test.cpp
#include<stdio.h>
#include<stdlib.h>
int gcd(int x,int y)
{
int r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
int main(int argc,char*argv[])
{
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>test 1235 1236
3
gcd=1
請按任意鍵繼續 . . .
C:\Documents and Settings\user>dir/w
磁碟區 C 中的磁碟是 Win XP
磁碟區序號: F809-3433
C:\Documents and Settings\user 的目錄
[.] [..] [Favorites] [My Documents]
[WINDOWS] [「開始」功能表] [桌面]
0 個檔案 0 位元組
7 個目錄 8,905,940,992 位元組可用
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>type test.cpp
#include<stdio.h>
#include<stdlib.h>
int gcd(int x,int y)
{
int r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
int main(int argc,char*argv[])
{
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>test 1235 1236
3
gcd=1
請按任意鍵繼續 . . .
#include <stdio.h>
#include <stdlib.h>
int gcd(int x,int y)
{
int ans;
if(x%y==0)
{
ans=y;
}
else
{
ans=gcd(y,x%y);
}
return ans;
}
int main(int arge,char *argv[]){
int n=arge;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("%d\n",x+y);
printf ("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>type main.cpp
#include <stdio.h>
#include <stdlib.h>
int gcd(int x,int y)
{
int ans;
if(x%y==0)
{
ans=y;
}
else
{
ans=gcd(y,x%y);
}
return ans;
}
int main(int arge,char *argv[]){
int n=arge;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("%d\n",x+y);
printf ("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
C:\Documents and Settings\user\桌面>專案1 987654321 123456789
3
1111111110
gcd=9
請按任意鍵繼續 . . .
C:\Documents and Settings\user\桌面>type 2.cpp
#include <stdio.h>
#include <stdlib.h>
int gcd(int x,int y)
{
int r=x%y;
if (r==0)
return y;
else
return gcd(y,r);
}
int main(int argc,char *argv[]){
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("Pause");
return 0;
}
C:\Documents and Settings\user\桌面>2 12 36
3
gcd=12
C:\Documents and Settings\user\桌面>type 2.cpp
#include <stdio.h>
#include <stdlib.h>
int gcd(int x,int y)
{
int r=x%y;
if (r==0)
return y;
else
return gcd(y,r);
}
int main(int argc,char *argv[]){
int n=argc;
printf("%d\n",n);
int x=atoi(argv[1]);
int y=atoi(argv[2]);
printf("gcd=%d\n",gcd(x,y));
system("Pause");
return 0;
}
C:\Documents and Settings\user\桌面>2 12 36
3
gcd=12
Microsoft Windows XP [版本 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\user>cd 桌面
C:\Documents and Settings\user\桌面>dir/w
磁碟區 C 中的磁碟是 Win XP
磁碟區序號: F809-3433
C:\Documents and Settings\user\桌面 的目錄
[.] [..]
Dev-C++.lnk ITE測驗系統-Client端程式.lnk
Makefile.win Microsoft Visual Studio 2008.lnk
PhotoImpact 10.lnk PowerCam5.lnk
SPSS 14.0 中文視窗版.lnk SQL Server Management Studio.lnk
[src] test.cpp
test.dev test.exe
test.o test.sln
TQC測驗系統-Client端程式.lnk Wireshark.lnk
WorkFlowERP 系統.lnk 網際網路.lnk
17 個檔案 442,380 位元組
3 個目錄 8,808,882,176 位元組可用
C:\Documents and Settings\user\桌面>type test.cpp
#include <cstdlib>
#include <iostream>
using namespace std;
int gcd(int,int);
int main(int argc, char *argv[])
{
int m=atoi(argv[1]);
int n=atoi(argv[2]);
printf("gcd=%d\n",gcd(m,n));
system("PAUSE");
return EXIT_SUCCESS;
}
int gcd(int m,int n)
{
int ans;
if(m%n==0)
{
ans=n;
}
else
{
ans=gcd(n,m%n);
}
return ans;
}
C:\Documents and Settings\user\桌面>test 123 456
gcd=3
請按任意鍵繼續 . . .
張貼留言