討論串[問題]最大公因數
共 5 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓0(0推 0噓 4→)留言4則,0人參與, 最新作者RMC (慢慢)時間15年前 (2010/02/11 13:08), 編輯資訊
0
0
0
內容預覽:
#include <stdio.h>. #include <stdlib.h>. int f(int a,int b){. int i,ans;. for(i=1;i<=a;i++){. if(a%i==0&&b%i==0). ans=i;}. printf("%d",ans);. }. int m
(還有378個字)

推噓1(1推 0噓 7→)留言8則,0人參與, 最新作者s3748679 (冷羽憶塵)時間15年前 (2010/02/04 01:47), 編輯資訊
0
0
0
內容預覽:
orz...看起來我寫法好像比較不一樣說. Code:. #include <iostream>. using namespace std;. int GCF(int a, int b);. int main(). {. cout << "請輸入兩個正整數: ";. int a, b;. cin >
(還有304個字)

推噓1(1推 0噓 5→)留言6則,0人參與, 最新作者andyisman (andychen)時間15年前 (2010/02/04 01:05), 編輯資訊
0
0
0
內容預覽:
這樣比較簡潔XD. #include<iostream>. #include<algorithm>. using namespace std;. int main(). {. int a, b; //歐不 剛剛忘記加了 Q Q. printf("輸入兩個數求最大公因數\n請輸入第一個正整數:");.
(還有179個字)

推噓3(3推 0噓 1→)留言4則,0人參與, 最新作者flydragon198 (阿凡達要看3D的)時間15年前 (2010/02/03 16:14), 編輯資訊
0
0
1
內容預覽:
http://nopaste.csie.org/34aae. 稍微改了一下,這樣比較好看,不過我沒寫註解@@. 要寫註解比較好. #include<stdio.h>. #include<stdlib.h>. int main(int argc,char *argv[]). {. int One,Tw
(還有761個字)

推噓12(12推 0噓 16→)留言28則,0人參與, 最新作者kin30503 (大ㄟ)時間15年前 (2010/02/03 14:16), 編輯資訊
0
0
0
內容預覽:
#include<stdio.h>. #include<stdlib.h>. main(). {. int a,b,q,r,t;. printf("請給我兩個正整數:");. scanf("%d %d",&a,&b);. if(a<=0||b<=0). {printf("請重新輸入~~~");}.
(還有319個字)
首頁
上一頁
1
下一頁
尾頁