- 類似費氏數列 f[0]=1, f[1]=2, f[n]=2*f[n-1]+f[n-2],求f[5]=?
- gcd(52,39)=?
- 無窮迴圈
herrDeng網內搜尋
自訂搜尋
Ads
訂閱:
張貼留言 (Atom)
熱門文章
-
教育部為提昇全民資安素養與電腦防護能力,本部於101年9月5日至11月5日舉辦「全民資安素養自我評量」活動,請在活動期間內踴躍上網檢測資訊安全素養認知程度,並有機會參與抽獎,詳情請參閱活動網站(網址: https://isafe.moe.edu.tw/event
-
url="https://www.twse.com.tw/exchangeReport/STOCK_DAY?response=json&date=20220330&stockNo=2330"
-
先說明一下這是後知後覺的解答,所謂後知就是股票價格已知存在陣列(清單),當然就要用迴圈練習,雙迴圈暴力解需時O(n**2),當然不用,採python單一迴圈解答「最佳股票的買賣時機#LeetCode 121 Best Time to Buy and Sell Stock」,解...
-
你會用C的算子sizeof?
-
XOR prefixsum CPP python解Leetcode 1829 Maximum XOR for Each Query 其實這裡考慮的是元素個數為2^maximumBit的交換群,運算子為XOR。 [Python code請進]
-
Python C++使用字串find迴圈速解Leetcode 2490 Circular Sentence C++ & Python都有字串的find,用法都類似 split=s.find(' ', split+1)能找到s從index=split+1開...
64 則留言:
1.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int f[6],n;
f[0]=1;f[1]=2;
for(n=2;n<=5;n++)
{
f[n]=2*f[n-1]+f[n-2];
}
printf("f[5] = %d\n",f[5]);
system("pause");
return 0;
}
Ans=70
2.
#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 x=52,y=39;
printf("gcd = %d\n",gcd(x,y));
system("pause");
return 0;
}
Ans=13
3.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i=1;
while (i>0)
{
printf("i = %d\n",i++);
}
system("pause");
return 0;
}
1.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int f[6],n;
f[0]=1;f[1]=2;
for(n=2;n<=5;n++)
{
f[n]=2*f[n-1]+f[n-2];
}
printf("f[5] = %d\n",f[5]);
system("pause");
return 0;
}
Ans=70
2.
#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 x=52,y=39;
printf("gcd = %d\n",gcd(x,y));
system("pause");
return 0;
}
Ans=13
3.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i=1;
while (i>0)
{
printf("i = %d\n",i++);
}
system("pause");
return 0;
}
1.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int f[6];
int n;
f[0]=1;
f[1]=2;
for(n=2;n<=5;n++)
{
f[n]=2*f[n-1]+f[n-2];
}
printf("%d\n",f[5]);
system("pause");
return 0;
}
ans: f[5]=70
2.
#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 x=39;
int y=52;
printf("%d\n",gcd(x,y));
system("pause");
return 0;
}
gcd=13
3.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i=1;
while (i>0)
{
printf("i=%d\n",i++);
}
system("pause");
return 0;
}
1.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int f[6];
f[0]=1;
f[1]=2;
for(int i=2;i<=6;i++)
{f[i]=2*f[i-1]+f[i-2];}
printf("%d",f[5]);
system("pause");
return 0;
}
f[5]=70
2.
#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()
{
printf("%d",gcd(52,39));
system("pause");
return 0;
}
gcd=13
3.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i;
for(i<1;;i++)
printf("%d",i);
system("pause");
return 0;
}
1.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int f[6];
int n;
f[0]=1;
f[1]=2;
for (n=2;n<=5;n++)
{
f[n]=2*f[n-1]+f[n-2];
}
printf("%d\n",f[5]);
system("pause");
return 0;
}
f[5]=70
2.
#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 x=39;
int y=52;
printf("%d\n",gcd(x,y));
system("pause");
return 0;
}
gcd=13
3.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a=1;
for (a=1;a>=1;a++)
printf ("good",a);
system("pause");
return 0;
}
1.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int f[6];
int n;
f[0]=1;
f[1]=2;
for (n=2;n<=5;n++)
{
f[n]=2*f[n-1]+f[n-2];
}
printf("%d\n",f[5]);
system("pause");
return 0;
}
f[5]=70
2.
#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 x=39;
int y=52;
printf("%d\n",gcd(x,y));
system("pause");
return 0;
}
gcd=13
3.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a=1;
for (a=1;a>=1;a++)
printf ("good",a);
system("pause");
return 0;
}
1.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int f[6];
f[0]=1;
f[1]=2;
for(int i=2;i<7;i++)
{
f[i]=2*f[i-1]+f[i-2];
}
printf("%d",f[5]);
system("pause");
return 0;
}
f[5]=70
2.
#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()
{
printf("gcd=%d\n",gcd(52,39));
system("pause");
return 0;
}
gcd=13
3.
#include <stdio.h>
#include <stdlib.h>
int main()
{
for(int i=1;i>0;i++)
printf("hi");
system("pause");
return 0;
}
1.類似費氏數列 f[0]=1, f[1]=2, f[n]=2*f[n-1]+f[n-2],求f[5]=?
#include<iostream>
#include<cstdlib>
using namespace std;
int main(){
unsigned f[6];
f[0]=1;
f[1]=2;
int i;
for(i=2;i<=5;i++)
{
f[i]=2*f[i-1]+f[i-2];
cout<<"f["<<i<<"]="<<f[i]<<'\n';
}
system("pause");
return 0;
}
f[5]=70
2.gcd(52,39)=?
#include<stdio.h>
#include<stdlib.h>
int gcd(int,int);
int main()
{
int m=52,n=39;
printf("gcd=%d\n",gcd(m,n));
system("pause");
return 0;
}
int gcd(int m,int n)
{
int ans;
if(m%n==0)
{
ans=n;
}
else
{
ans=gcd(n,m%n);
}
return ans;
}
gcd(52,39)=13
3.無窮迴圈
#include<stdio.h>
#include<stdlib.h>
int main(){
int i;
for(i=1;i>=0;i++)
printf("HAPPY!!\n",i);
system("pause");
return 0;
}
1.費式數列
#include<stdio.h>
#include<stdlib.h>
int main()
{
int f[6];
f[0]=1;
f[1]=2;
int n;
for(n=2;n<=5;n++)
{
f[n]=2*f[n-1]+f[n-2];
}
printf("%d\n",f[5]);
system("pause");
return 0;
}
答案:70
2.gcd(52,39)
#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 x=39,y=52;
printf("GCD=%d\n",gcd(x,y));
system("pause");
return 0;
}
答案:13
3.無窮迴圈
#include<stdio.h>
#include<stdlib.h>
int main()
{
int i=1;
while(i>0)
{
printf("i=%d\n",i++);
}
system("pause");
return 0;
}
1.費式數列
#include<stdio.h>
#include<stdlib.h>
int main()
{
int f[6];
f[0]=1;
f[1]=2;
int n;
for(n=2;n<=5;n++)
{
f[n]=2*f[n-1]+f[n-2];
}
printf("%d\n",f[5]);
system("pause");
return 0;
}
答案:70
2.gcd(52,39)
#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 x=39,y=52;
printf("GCD=%d\n",gcd(x,y));
system("pause");
return 0;
}
答案:13
3.無窮迴圈
#include<stdio.h>
#include<stdlib.h>
int main()
{
int i=1;
while(i>0)
{
printf("i=%d\n",i++);
}
system("pause");
return 0;
}
1.
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int n;
int f[6];
f[0]=1;
f[1]=2;
for(n=2;n<=5;n++)
{
f[n]=2*f[n-1]+f[n-2];
}
printf("%d",f[5]);
system("PAUSE");
return 0;
}
ans=70
2.
#include <stdio.h>
#include <stdlib.h>
int gcd(int m,int n)
{
int ans;
if(m%n==0)
{
ans=n;
}
else
{
ans=(n,m%n);
}
return ans;
}
int main(int argc, char *argv[])
{
int x,y;
scanf("%d %d",&x,&y);
printf("%d %d\n",x,y);
gcd(x,y);
printf("%d和%d的公因數是:%d",x,y,gcd(x,y));
system("PAUSE");
return 0;
}
ans=13
3.
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int x;
for(x=0; ;x++)
{
printf("ABCD!!!");
}
system("PAUSE");
return 0;
}
1.費式數列
#include<stdio.h>
#include<stdlib.h>
int main()
{
int f[6];
f[0]=1;
f[1]=2;
int n;
for(n=2;n<=5;n++)
{
f[n]=2*f[n-1]+f[n-2];
}
printf("%d\n",f[5]);
system("pause");
return 0;
}
答案:70
2.gcd(52,39)
#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 x=39,y=52;
printf("GCD=%d\n",gcd(x,y));
system("pause");
return 0;
}
答案:13
3.無窮迴圈
#include<stdio.h>
#include<stdlib.h>
int main()
{
int i=1;
while(i>0)
{
printf("i=%d\n",i++);
}
system("pause");
return 0;
}
#include <stdio.h>
#include <stdlib.h>
int main()
{
int f[6],n;
f[0]=1;
f[1]=2;
for(n=2;n<6;n++)
{
f[n]=2*f[n-1]+f[n-2];
}
printf("%d\n",f[5]);
system("pause");
return 0;
}
答案:70
#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 x=39,y=52;
printf("%d\n",gcd(x,y));
system("pause");
return 0;
}
答案:13
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i=1;
while(i>0)
{
printf("i=%d\n",i++);
}
system("pause");
return 0;
}
1.
#include<stdio.h>
#include<stdlib.h>
int main()
{
int f[6],n;
f[0]=1;
f[1]=2;
for (n=2;n<6;n++)
{
f[n]=2*f[n-1]+f[n-2];
}
printf("%d\n",f[5]);
system("pause");
return 0;
}
答案:70
2.
#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 x=39,y=52;
printf("%d\n",gcd(x,y));
system("pause");
return 0;
}
答案:13
3.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i=1;
while (i>0)
{
printf("i=%d\n",i++);
}
system("pause");
return 0;
}
1.費式數列
#include<stdio.h>
#include<stdlib.h>
int main()
{
int f[6];
f[0]=1;
f[1]=2;
int n;
for(n=2;n<=5;n++)
{
f[n]=2*f[n-1]+f[n-2];
}
printf("%d\n",f[5]);
system("pause");
return 0;
}
答案:70
2.gcd(52,39)
#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 x=39,y=52;
printf("GCD=%d\n",gcd(x,y));
system("pause");
return 0;
}
答案:13
3.無窮迴圈
#include<stdio.h>
#include<stdlib.h>
int main()
{
int i=1;
while(i>0)
{
printf("i=%d\n",i++);
}
system("pause");
return 0;
}
1.費式數列
#include<stdio.h>
#include<stdlib.h>
int main()
{
int f[6];
f[0]=1;
f[1]=2;
int n;
for(n=2;n<=5;n++)
{
f[n]=2*f[n-1]+f[n-2];
}
printf("%d\n",f[5]);
system("pause");
return 0;
}
答案:70
2.gcd(52,39)
#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 x=39,y=52;
printf("GCD=%d\n",gcd(x,y));
system("pause");
return 0;
}
答案:13
3.無窮迴圈
#include<stdio.h>
#include<stdlib.h>
int main()
{
int i=1;
while(i>0)
{
printf("i=%d\n",i++);
}
system("pause");
return 0;
}
1.
#include <stdio.h>
#include <stdlib.h>
int main(){
int f[6];
int i;
f[0]=1,f[1]=2;
for(i=2; i<=5; i++){
f[i]=2*f[i-1]+f[i-2];
}
printf("%d\n",f[5]);
system("pause");
return 0;
}
2.
#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(){
printf("%d",gcd(52,39));
system("pause");
return 0;
}
3.
#include <stdio.h>
#include <stdlib.h>
int main()
{
for(;;)
printf("happy!");
system("Pause");
return 0;
}
1.
#include <stdio.h>
#include <stdlib.h>
int main(){
int f[6];
int i;
f[0]=1,f[1]=2;
for(i=2; i<=5; i++){
f[i]=2*f[i-1]+f[i-2];
}
printf("%d\n",f[5]);
system("pause");
return 0;
}
2.
#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(){
printf("%d",gcd(52,39));
system("pause");
return 0;
}
3.
#include <stdio.h>
#include <stdlib.h>
int main()
{
for(;;)
printf("happy!");
system("Pause");
return 0;
}
#include <iostream>
using namespace std;
int main()
{
unsigned f[52];
f[0]=1;
f[1]=2;
for (int i=2;i<=7;i++)
{
f[i]=2*f[i-1]+f[i-2];
cout<<i<<"->"<<f[i]<<endl;
}
system ("pause");
return 0;
}
f[5]=70
#include <stdio.h>
#include <stdlib.h>
int gcd(int a,int b)
{
if(a%b==0)
return b;
return gcd(b,a%b);
}
int main()
{
int c;
c=gcd(52,39);
printf("gcd(52,39)\n最大公因數=%d\n", c);
system("pause");
return 0;
}
最大公因數=13
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int i;
for(i=0;;i++)
{
printf("hello!");
}
system("PAUSE");
return 0;
}
1.
#include <stdio.h>
#include <stdlib.h>
int main(){
int f[6];
int i;
f[0]=1,f[1]=2;
for(i=2; i<=5; i++){
f[i]=2*f[i-1]+f[i-2];
}
printf("%d\n",f[5]);
system("pause");
return 0;
}
2.
#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(){
printf("%d",gcd(52,39));
system("pause");
return 0;
}
3.
#include <stdio.h>
#include <stdlib.h>
int main()
{
for(;;)
printf("happy!");
system("Pause");
return 0;
}
1.
#include <stdio.h>
#include <stdlib.h>
int main(){
int f[6];
int i;
f[0]=1,f[1]=2;
for(i=2; i<=5; i++){
f[i]=2*f[i-1]+f[i-2];
}
printf("%d\n",f[5]);
system("pause");
return 0;
}
2.
#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(){
printf("%d",gcd(52,39));
system("pause");
return 0;
}
3.
#include <stdio.h>
#include <stdlib.h>
int main()
{
for(;;)
printf("happy!");
system("Pause");
return 0;
}
1.
#include <stdio.h>
#include <stdlib.h>
int main ()
{
int f[6];
int n;
f[0]=1;
f[1]=2;
for (n=2;n<=5;n++)
{
f[n]=2*f[n-1]+f[n-2];}
printf("%d\n",f[5]);
system("pause");
return 0;
}
Ans:70
2.
#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 x=39;
int y=52;
printf ("%d\n",gcd(x,y));
system ("pause");
return 0;
}
Ans:13
3.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int t=5;
for (t=5;t>=5;t++)
printf("5",t);
system ("pause");
return 0;
}
1.
#include<stdio.h>
#include<stdlib.h>
int main()
{
int f[6];
int n;
f[0]=1;
f[1]=2;
for(n=2;n<=5;n++)
{
f[n]=2*f[n-1]+f[n-2];}
printf("%d\n",f[5]);
system("pause");
return 0;
}
2.
#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 x=39;
int y=52;
printf("%d\n",gcd(x,y));
system("pause");
return 0;
}
3.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int q=6;
for (q=6;q>=6;q++)
printf("6",q);
system("pause");
return 0;
}
1.
#include<stdio.h>
#include<stdlib.h>
int main(){
int i,f[6];
f[0]=1;
f[1]=2;
for(i=2;i<=5;i++)
f[i]=2*f[i-1]+f[i-2];
printf("%d\n",f[5]);
system("pause");
return 0;}
2.
#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 z;
z=gcd(52,39);
printf("gcd(52,39)=%d\n",z);
system("pause");
return 0;}
3.
#include<stdio.h>
#include<stdlib.h>
int main(){
int i;
for(i=0;;i++)
printf("hi!",i);
system("pause");
return 0;}
答:
70
gcd=13
1.
#include <stdio.h>
#include <stdlib.h>
int main ()
{
int f[6];
int n;
f[0]=1;
f[1]=2;
for (n=2;n<=5;n++)
{
f[n]=2*f[n-1]+f[n-2];}
printf("%d\n",f[5]);
system("pause");
return 0;
}
Ans:70
2.
#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 x=39;
int y=52;
printf ("%d\n",gcd(x,y));
system ("pause");
return 0;
}
Ans:13
3.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int t=2;
for (t=2;t>=2;t++)
printf("2",t);
system ("pause");
return 0;
}
1.
#include <stdio.h>
#include <stdlib.h>
int main(){
int f[6];
int i;
f[0]=1,f[1]=2;
for(i=2; i<=5; i++){
f[i]=2*f[i-1]+f[i-2];
}
printf("%d\n",f[5]);
system("pause");
return 0;
}
2.
#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(){
printf("%d",gcd(52,39));
system("pause");
return 0;
}
3.
#include <stdio.h>
#include <stdlib.h>
int main()
{
for(;;)
printf("happy!");
system("Pause");
return 0;
}
1.
#include <stdio.h>
#include <stdlib.h>
int main(){
int f[6];
int i;
f[0]=1,f[1]=2;
for(i=2; i<=5; i++){
f[i]=2*f[i-1]+f[i-2];
}
printf("%d\n",f[5]);
system("pause");
return 0;
}
2.
#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(){
printf("%d",gcd(52,39));
system("pause");
return 0;
}
3.
#include <stdio.h>
#include <stdlib.h>
int main()
{
for(;;)
printf("happy!");
system("Pause");
return 0;
}
1.
#include <stdio.h>
#include <stdlib.h>
int main(){
int f[6];
int i;
f[0]=1,f[1]=2;
for(i=2; i<=5; i++){
f[i]=2*f[i-1]+f[i-2];
}
printf("%d\n",f[5]);
system("pause");
return 0;
}
2.
#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(){
printf("%d",gcd(52,39));
system("pause");
return 0;
}
3.
#include <stdio.h>
#include <stdlib.h>
int main()
{
for(;;)
printf("happy!");
system("Pause");
return 0;
}
1.
#include <stdio.h>
#include <stdlib.h>
int main(){
int f[6];
int i;
f[0]=1,f[1]=2;
for(i=2; i<=5; i++){
f[i]=2*f[i-1]+f[i-2];
}
printf("%d\n",f[5]);
system("pause");
return 0;
}
2.
#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(){
printf("%d",gcd(52,39));
system("pause");
return 0;
}
3.
#include <stdio.h>
#include <stdlib.h>
int main()
{
for(;;)
printf("happy!");
system("Pause");
return 0;
}
1.
#include <stdio.h>
#include <stdlib.h>
int main(){
int f[6];
int i;
f[0]=1,f[1]=2;
for(i=2; i<=5; i++){
f[i]=2*f[i-1]+f[i-2];
}
printf("%d\n",f[5]);
system("pause");
return 0;
}
2.
#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(){
printf("%d",gcd(52,39));
system("pause");
return 0;
}
3.
#include <stdio.h>
#include <stdlib.h>
int main()
{
for(;;)
printf("happy!");
system("Pause");
return 0;
}
#include<stdio.h>
#include<stdlib.h>
int main()
{
int f[6];
f[0]=1;
f[1]=2;
for(int n=2;n<=5;n++)
{
f[n]=2*f[n-1]+f[n-2];
}
printf("%d\n",f[5]);
system("pause");
return 0;
}
輸出70
#include<stdio.h>
#include<stdlib.h>
int gcd(int,int);
int main()
{
int x,y;
x=52;
y=39;
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
int gcd(int x,int y)
{
int r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
輸出13
#include<stdio.h>
#include<stdlib.h>
int main()
{
int i=1;
while(i>0)
printf("i=%d\n",i++);
system("pause");
return 0;
}
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int n;
int f[6];
f[0]=1;
f[1]=2;
for(n=2;n<=5;n++)
{
f[n]=2*f[n-1]+f[n-2];
}
printf("%d",f[5]);
system("PAUSE");
return 0;
}
ans=70
#include <stdio.h>
#include <stdlib.h>
int gcd(int m,int n)
{
int ans;
if(m%n==0)
{
ans=n;
}
else
{
ans=(n,m%n);
}
return ans;
}
int main(int argc, char *argv[])
{
int x,y;
scanf("%d %d",&x,&y);
printf("%d %d\n",x,y);
gcd(x,y);
printf("%d和%d的公因數是:%d",x,y,gcd(x,y));
system("PAUSE");
return 0;
}
ans=13
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int x;
for(x=0; ;x++)
{
printf("ABCD!!!");
}
system("PAUSE");
return 0;
}
1.
#include <stdio.h>
#include <stdlib.h>
{
int f[6];
int i ,sum
f[0]=1;
f[1]=2;
for(i=1;i<=5;i++)
{f[n]=f[n-1]+2*f[n-2]};
printf("%d\n",f[5]);
system("pause");
return 0;
}
F[5]=70
2.
#include <stdio.h>
#include <stdlib.h>
int gcd(int,int);
int main()
{
int x,y;
x=52;
y=39;
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
int gcd(int x,int y)
{
int r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
3.
#include <stdio.h>
#include <stdlib.h>
int main()
{
for(;;)
printf("yes");
system("Pause");
return 0;
}
1.
#include <stdio.h>
#include <stdlib.h>
{
int f[6];
int i ,sum
f[0]=1;
f[1]=2;
for(i=1;i<=5;i++)
{f[n]=f[n-1]+2*f[n-2]};
printf("%d\n",f[5]);
system("pause");
return 0;
}
F[5]=70
2.
#include <stdio.h>
#include <stdlib.h>
int gcd(int,int);
int main()
{
int x,y;
x=52;
y=39;
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
int gcd(int x,int y)
{
int r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
3.
#include <stdio.h>
#include <stdlib.h>
int main()
{
for(;;)
printf("yes");
system("Pause");
return 0;
}
1.
#include <stdio.h>
#include <stdlib.h>
{
int f[6];
int i ,sum
f[0]=1;
f[1]=2;
for(i=1;i<=5;i++)
{f[n]=f[n-1]+2*f[n-2]};
printf("%d\n",f[5]);
system("pause");
return 0;
}
F[5]=70
2.
#include <stdio.h>
#include <stdlib.h>
int gcd(int,int);
int main()
{
int x,y;
x=52;
y=39;
printf("gcd=%d\n",gcd(x,y));
system("pause");
return 0;
}
int gcd(int x,int y)
{
int r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
3.
#include <stdio.h>
#include <stdlib.h>
int main()
{
for(;;)
printf("yes");
system("Pause");
return 0;
}
#include <stdio.h>
#include <stdlib.h>
int main()
{
int courses[9][5]={0,0,0,0,0,
0,3,5,0,10,
1,3,5,8,10,
1,3,5,8,10,
2,4,6,9,0,
2,4,6,9,0,
0,4,7,9,0,
0,0,7,0,0,
0,0,7,0,0};
int i,j;
printf("課表\n");
for(i=0;i<9;i++)
{
for(j=0;j<5;j++)
{
printf("%d\t",courses[i][j]);
}
printf("\n");
}
printf("\n代碼說明\n");
printf("0:空堂\n1:智慧財產權\n2:刑法\n3:統計學\n4:應用統計\n5:網路行銷\n6:美學\n\
7:電子商務\n8:導師時間\n9:資料結構\n10:會計學");
system("pause");
return 0;
}
1.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int f[6],n;
f[0]=1;
f[1]=2;
for(n=2;n<6;n++)
{
f[n]=2*f[n-1]+f[n-2];
}
printf("%d\n",f[5]);
system("pause");
return 0;
}
ans:70
2.
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int a = 39 ;
int b = 52 ;
int r = 39 ;
while ( r >= 1 ) {
if ( a % r == 0 && b % r == 0 ) {
printf( "%d", r ) ;
r = 1 ;
}
r-- ;
}
system("PAUSE");
return EXIT_SUCCESS;
}
ans:13
3.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i=1;
while(i>0)
{
printf("i=%d\n",i++);
}
system("pause");
return 0;
}
#include <stdio.h>
#include <stdlib.h>
int main()
{
int f[6],n;
f[0]=1;
f[1]=2;
for(n=2;n<6;n++)
{
f[n]=2*f[n-1]+f[n-2];
}
printf("%d\n",f[5]);
system("pause");
return 0;
}
ans:70
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int a = 39 ;
int b = 52 ;
int r = 39 ;
while ( r >= 1 ) {
if ( a % r == 0 && b % r == 0 ) {
printf( "%d", r ) ;
r = 1 ;
}
r-- ;
}
system("PAUSE");
return EXIT_SUCCESS;
}
ans:13
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i=1;
while(i>0)
{
printf("i=%d\n",i++);
}
system("pause");
return 0;
}
1.
#include<stdio.h>
#include<stdlib.h>
int main()
{
int f[6];
int i=2;
f[0]=1;
f[1]=2;
for(i=2;i<=5;i++)
{
f[i]=2*f[i-1]+f[i-2];
}
printf("%d\n",f[5]);
system("pause");
return 0;
}
2.
#include<stdlib.h>
int gcd(int a,int b)
{
if(a%b==0)
return b;
else
return gcd(b,a%b);
}
int main()
{
int c;
c=gcd(52,39);
printf("%d\n",c);
system("pause");
return 0;
}
3.
#include<stdio.h>
#include<stdlib.h>
int main()
{
int i;
for(i=0;;i++)
{
printf("123");
}
system("pause");
return 0;
}
1.費式數列
#include <stdio.h>
#include <stdlib.h>
int main()
{
int f[6];
int i;
f[0]=1;
f[1]=2;
for(i=2;i<=5;i++)
{
f[i]=2*f[i-1]+f[i-2];
}
printf("%d\n",f[5]);
system("pause");
return 0;
}
Ans:70
2.gcd(52,39)
#include <stdio.h>
#include <stdlib.h>
int gcd (int x, int y)
{
int r;
if(x%y==0)
{r=y;}
else
{r=(y,x%y);}
return r;
}
int main()
{
int i,j;
scanf("%d %d",&i,&j);
printf("%d",gcd(i,j));
system {"pause");
return 0;
}
Ans:13
3.無線迴圈
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i;
for(i=0;;i++)
printf("Good Job!\n");
system("pause");
return 0;
}
第一
#include <stdio.h>
#include <stdlib.h>
int main()
{
int f[6];
int i;
f[0]=1;
f[1]=2;
for (i=2;i<6;i++)
{ f[i]=2*f[i-1]+f[i-2];}
printf ("%d\n",f[5]);
system ("pause");
return 0;
}
第二
#include <stdio.h>
#include <stdlib.h>
int gcd (int x, int y)
{
int r;
if(x%y==0)
{r=y;}
else
{r=(y,x%y);}
return r;
}
int main()
{
int i,j;
scanf("%d %d",&i,&j);
printf("%d",gcd(i,j));
system ("pause");
return 0;
}
第三
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i;
for (i=0;;i++)
printf ("HOLLO",i);
system ("pause");
return 0;
}
第一
#include <stdio.h>
#include <stdlib.h>
int main()
{
int f[6];
int i;
f[0]=1;
f[1]=2;
for (i=2;i<6;i++)
{ f[i]=2*f[i-1]+f[i-2];}
printf ("%d\n",f[5]);
system ("pause");
return 0;
}
A:70
第二
#include <stdio.h>
#include <stdlib.h>
int gcd (int x, int y)
{
int r;
if(x%y==0)
{r=y;}
else
{r=(y,x%y);}
return r;
}
int main()
{
int i,j;
scanf("%d %d",&i,&j);
printf("%d",gcd(i,j));
system ("pause");
return 0;
}
GCD=13
第三
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i;
for (i=0;;i++)
printf ("HOLLO",i);
system ("pause");
return 0;
}
1.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int f[6];
f[0]=1;
f[1]=2;
for(int i=2;i<=5;i++)
f[i]=2*f[i-1]+f[i-2];
printf("%d\n",f[5]);
system("Pause");
return 0;
}
ANS:70
2.
#include <stdio.h>
#include <stdlib.h>
int gcd(int a,int b)
{
if(a%b==0)
return b;
return gcd(b,a%b);
}
int main()
{
int c;
c=gcd(52,39);
printf("最大公因數=%d\n", c);
system("pause");
return 0;
}
ANS:最大公因數=13
3.
#include <stdio.h>
#include <stdlib.h>
int main()
{
for(;;){
printf("hello");}
system("Pause");
return 0;
}
#include<iostream>
#include<cstdlib>
using namespace std;
int main(){
unsigned f[6];
f[0]=1;
f[1]=2;
int i;
for(i=2;i<=5;i++)
{
f[i]=2*f[i-1]+f[i-2];
cout<<"f["<<i<<"]="<<f[i]<<'\n';
}
system("pause");
return 0;
}
f[5]=70
#include<iostream>
#include<cstdlib>
using namespace std;
int main(){
unsigned f[6];
f[0]=1;
f[1]=2;
int i;
for(i=2;i<=5;i++)
{
f[i]=2*f[i-1]+f[i-2];
cout<<"f["<<i<<"]="<<f[i]<<'\n';
}
system("pause");
return 0;
}
f[5]=70
#include<iostream>
#include<cstdlib>
using namespace std;
int main(){
unsigned f[6];
f[0]=1;
f[1]=2;
int i;
for(i=2;i<=5;i++)
{
f[i]=2*f[i-1]+f[i-2];
cout<<"f["<<i<<"]="<<f[i]<<'\n';
}
system("pause");
return 0;
}
f[5]=70
#include<stdio.h>
#include<stdlib.h>
int gcd(int,int);
int main()
{
int m=52,n=39;
printf("gcd=%d\n",gcd(m,n));
system("pause");
return 0;
}
int gcd(int m,int n)
{
int ans;
if(m%n==0)
{
ans=n;
}
else
{
ans=gcd(n,m%n);
}
return ans;
}
gcd(52,39)=13
#include<stdio.h>
#include<stdlib.h>
int main(){
int i;
for(i=1;i>=0;i++)
printf("HAPPY!!\n",i);
system("pause");
return 0;
}
#include<stdio.h>
#include<stdlib.h>
int main(){
int i;
for(i=1;i>=0;i++)
printf("HAPPY!!\n",i);
system("pause");
return 0;
}
#include<stdio.h>
#include<stdlib.h>
int main(){
int i;
for(i=1;i>=0;i++)
printf("HAPPY!!\n",i);
system("pause");
return 0;
}
#include<stdio.h>
#include<stdlib.h>
int gcd(int,int);
int main()
{
int m=52,n=39;
printf("gcd=%d\n",gcd(m,n));
system("pause");
return 0;
}
int gcd(int m,int n)
{
int ans;
if(m%n==0)
{
ans=n;
}
else
{
ans=gcd(n,m%n);
}
return ans;
}
gcd(52,39)=13
#include<stdio.h>
#include<stdlib.h>
int gcd(int,int);
int main()
{
int m=52,n=39;
printf("gcd=%d\n",gcd(m,n));
system("pause");
return 0;
}
int gcd(int m,int n)
{
int ans;
if(m%n==0)
{
ans=n;
}
else
{
ans=gcd(n,m%n);
}
return ans;
}
gcd(52,39)=13
1.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int f[6];
f[0]=1;
f[1]=2;
for(int i=2;i<7;i++)
{
f[i]=2*f[i-1]+f[i-2];
}
printf("%d",f[5]);
system("pause");
return 0;
}
Ans:70
2.
#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()
{
printf("gcd=%d\n",gcd(52,39));
system("pause");
return 0;
}
gcd=13
3.
#include <stdio.h>
#include <stdlib.h>
int main()
{
for(int i=1;i>0;i++)
printf("hello!");
system("pause");
return 0;
}
1.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int f[6];
f[0]=1;
f[1]=2;
for(int i=2;i<7;i++)
{
f[i]=2*f[i-1]+f[i-2];
}
printf("%d",f[5]);
system("pause");
return 0;
}
Ans:70
2.
#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()
{
printf("gcd=%d\n",gcd(52,39));
system("pause");
return 0;
}
gcd=13
3.
#include <stdio.h>
#include <stdlib.h>
int main()
{
for(int i=1;i>0;i++)
printf("good!");
system("pause");
return 0;
}
1.
#include<stdio.h>
#include<stdlib.h>
int main()
{
int f[6],i=2;
f[0]=1;
f[1]=2;
for(i=2;i<=5;i++)
{
f[i]=2*f[i-1]+f[i-2];
}
printf("%d\n",f[5]);
system("PAUSE");
return 0;
}
2.
#include<stdio.h>
#include<stdlib.h>
int gcd(int x,int y)
{
if(x%y==0)
return y;
else
return gcd(y,x%y);
}
int main()
{
int r;
r=gcd(52,39);
printf("%d\n",r);
system("pause");
return 0;
}
3.
#include<stdio.h>
#include<stdlib.h>
int main()
{
int X;
for(X=0;;X++)
{
printf(" ●");
}
system("pause");
return 0;
}
1.
#include <stdlib.h>
#include <stdio.h>
int main()
{
int f[6];
int n;
f[0]=1;
f[1]=2;
for(n=2;n<6;n++)
f[n]=2*f[n-1]+f[n-2];
printf("%d\n",f[5]);
system("pause");
return 0;
}
2.
#include <stdlib.h>
#include <stdio.h>
int gcd(int x,int y)
{
int r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
int main()
{
int x=39;
int y=52;
printf("%d",gcd(x,y));
system("pause");
return 0;
}
3.
#include <stdlib.h>
#include <stdio.h>
int main()
{
int n;
int i;
for(n=0;;n++)
{
printf("hello",n);
}
system("pause");
return 0;
}
1.
#include <stdlib.h>
#include <stdio.h>
int main()
{
int f[6];
int n;
f[0]=1;
f[1]=2;
for(n=2;n<6;n++)
f[n]=2*f[n-1]+f[n-2];
printf("%d\n",f[5]);
system("pause");
return 0;
}
2.
#include <stdlib.h>
#include <stdio.h>
int gcd(int x,int y)
{
int r=x%y;
if(r==0)
return y;
else
return gcd(y,r);
}
int main()
{
int x=39;
int y=52;
printf("%d",gcd(x,y));
system("pause");
return 0;
}
3.
#include <stdlib.h>
#include <stdio.h>
int main()
{
int n;
int i;
for(n=0;;n++)
{
printf("hello",n);
}
system("pause");
return 0;
}
#include <stdio.h>
int main()
{
int count,n,sum,a;
printf("找出完整數\n");
scanf("%d",&n);
for(count=1;count<=n;count++)
{
sum=0;
for(int i=1;i<count;i++)
{
a=count/i;
if(count==a*i)
{
sum=sum+a;
}
}
if(sum==count)
{
printf("%d\n",count);
}
}
return 0;
}
#include<stdio.h>
int main(void)
{
int i,n=0;
for(i=1;i>0;i++)
{
n=n+1;
printf("從1加到%d的答案是:%d\n",i,n);
}
return 0;
}
#include<stdio.h>
#include<stdlib.h>
int gcd(int,int);
int main()
{
int m=52,n=39;
printf("gcd=%d\n",gcd(m,n));
system("pause");
return 0;
}
int gcd(int m,int n)
{
int ans;
if(m%n==0)
{
ans=n;
}
else
{
ans=gcd(n,m%n);
}
return ans;
}
gcd(52,39)=13
#include<stdio.h>
#include<stdlib.h>
int gcd(int,int);
int main()
{
int m=52,n=39;
printf("gcd=%d\n",gcd(m,n));
system("pause");
return 0;
}
int gcd(int m,int n)
{
int ans;
if(m%n==0)
{
ans=n;
}
else
{
ans=gcd(n,m%n);
}
return ans;
}
gcd(52,39)=13
1
#include <stdio.h>
#include <stdlib.h>
int main(){
int f[6];
int i;
f[0]=1,f[1]=2;
for(i=2; i<=5; i++){
f[i]=2*f[i-1]+f[i-2];
}
printf("%d\n",f[5]);
system("pause");
return 0;
}
2
#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(){
printf("%d",gcd(52,39));
system("pause");
return 0;
}
3
#include <stdio.h>
#include <stdlib.h>
int main()
{
for(;;)
printf("happy!");
system("Pause");
return 0;
}
1.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int f[6],n;
f[0]=1;f[1]=2;
for(n=2;n<=5;n++)
{
f[n]=2*f[n-1]+f[n-2];
}
printf("f[5] = %d\n",f[5]);
system("pause");
return 0;
}
Ans=70
2.
#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 x=52,y=39;
printf("gcd = %d\n",gcd(x,y));
system("pause");
return 0;
}
Ans=13
3.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i=1;
while (i>0)
{
printf("i = %d\n",i++);
}
system("pause");
return 0;
}
1.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int f[6];
int n;
f[0]=1;
f[1]=2;
for (n=2;n<=5;n++)
{
f[n]=2*f[n-1]+f[n-2];
}
printf("%d\n",f[5]);
system("pause");
return 0;
}
f[5]=70
2.
#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 x=39;
int y=52;
printf("%d\n",gcd(x,y));
system("pause");
return 0;
}
gcd=13
3.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a=1;
for (a=1;a>=1;a++)
printf ("good",a);
system("pause");
return 0;
}
張貼留言