題目:古典問題:有一對兔子,從出生后第3個月起每個月都生一對兔子,小兔子長到第三個月后每個月又生一對兔子,假如兔子都不死,問每個月的兔子總數為多少? //這是一個菲波拉契數列問題 public class lianxi01 { public static void main(String[] args) { System.out.println("第1個月的兔子對數: 1"); System.out.println("第2個月的兔子對數: 1"); int f1 = 1, f2 = 1, f, M=24; for(int i=3; i<=M; i++) { f = f2; f2 = f1 + f2; f1 = f; System.out.println("第" + i +"個月的兔子對數: "+f2); } } } 【程序2】 題目:判斷101-200之間有多少個素數,并輸出所有素數。 程序分析:判斷素數的方法:用一個數分別去除2到sqrt(這個數),如果能被整除, 則表明此數不是素數,反之是素數。 public class lianxi02 { public static void main(String[] args) { int count = 0; for(int i=101; i<200; i+=2) { boolean b = false; for(int j=2; j<=Math.sqrt(i); j++) { if(i % j == 0) { b = false; break; } else { b = true; } } if(b == true) {count ++;System.out.println(i );} } System.out.println( "素數個數是: " + count); } } 【程序3】 題目:打印出所有的 "水仙花數 ",所謂 "水仙花數 "是指一個三位數,其各位數字立方和等于該數本身。例如:153是一個 "水仙花數 ",因為153=1的三次方+5的三次方+3的三次方。 public class lianxi03 { public static void main(String[] args) { int b1, b2, b3;
上傳時間: 2017-12-24
上傳用戶:Ariza
#include<stdio.h> #include<windows.h> int xuanxiang; int studentcount; int banjihao[100]; int xueqihao[100][10]; char xm[100][100]; int xuehao[100][10]; int score[100][3]; int yuwen; int shuxue[000]; int yingyu[100]; int c[100]; int p; char x[1000][100]="",y[100][100]="";/*x學院 y專業 z班級*/ int z[100]; main() { void input(); void inputsc(); void alter(); void scbybannji(); printf("--------學生成績管理-----\n"); printf("請按相應數字鍵來實現相應功能\n"); printf("1.錄入學生信息 2.錄入學生成績 3.修改學生成績\n"); printf("4.查詢學生成績 5.不及格科目及名單 6.按班級輸出學生成績單\n"); printf("請輸入你要實現的功能所對應的數字:"); scanf("%d",&xuanxiang); system("cls"); getchar(); switch (xuanxiang) { case 1:input(); case 2:inputsc(); case 3:alter(); /*case 4:select score(); case 5:bujigekemujimingdan();*/ case 6:scbybanji; } } void input() { int i; printf("請輸入你的學院名稱:"); gets(x); printf("請輸入你的專業名稱:"); gets(y); printf("請輸入你的班級號:"); scanf("%d",&z); printf("請輸入你們一個班有幾個人:"); scanf("%d",&p); system("cls"); for(i=0;i<p;i++) { printf("請輸入第%d個學生的學號:",i+1); scanf("%d",xuehao[i]); getchar(); printf("請輸入第%d個學生的姓名:",i+1); gets(xm[i]); system("cls"); } printf("您已經錄入完畢您的班級所有學生的信息!\n"); printf("您的班級為%s%s%s\n",x,y,z); /*alter(p);*/ } void inputsc() { int i; for(i=0;i<p;i++) { printf("\n"); printf("--------------------------------------------------------------------------------\n\n"); printf("\t\t\t\t錄入學生的成績\n\n\n"); printf("--------------------------------------------------------------------------------\n\n"); printf("\t\t\t\t%s\n",xm[i]); printf("\n"); printf("\t\t\t\t數學:"); scanf("%d",&shuxue[i]); printf("\n"); getchar(); printf("\t\t\t\t英語:"); scanf("%d",&yingyu[i]); printf("\n"); getchar(); printf("\t\t\t\tc語言:"); scanf("%d",&c[i]); system("cls"); } } void alter() { int i;/*循環變量*/ int m[10000];/*要查詢的學號*/ int b;/*修改后的成績*/ char kemu[20]=""; printf("請輸入你要修改的學生的學號"); scanf("%d",&m); for (i=0;i<p;i++) { if (m==xuehao[i]) { printf("%s的數學成績為%d,英語成績為%d,c語言成績為%d,xm[i],shuxue[i],yingyu[i],c[i]"); printf("請輸入你想修改的科目");} } gets(kemu); getchar(); if (kemu=="數學"); { scanf("%d",&b); shuxue[i]=b;} if (kemu=="英語"); { scanf("%d",&b); yingyu[i]=b;} if (kemu=="c語言"); { scanf("%d",&b); c[i]=b; } printf("%s的數學成績為%d,英語成績為%d,c語言成績為%d,xm[i],shuxue[i],yingyu[i],c[i]"); } void scbybannji() { int i; char zyname[20]; int bjnumber; printf("請輸入你的專業名稱"); scanf("%s",&zyname); printf("請輸入你的班級號"); scanf("%d",&bjnumber); for (i=0;i<p;i++) { if (zyname==y[i]); if (bjnumber==z[i]); printf("專業名稱%s班級號%d數學成績%d英語成績%dc語言成績%d,y[i],z[i],shuxue[i],yingyu[i],c[i]"); } }
標簽: c語言
上傳時間: 2018-06-08
上傳用戶:2369043090
|- 數據科學速查表 - 0 B|- 遷移學習實戰 - 0 B|- 零起點Python機器學習快速入門 - 0 B|- 《深度學習入門:基于Python的理論與實現》高清中文版PDF+源代碼 - 0 B|- 《Python生物信息學數據管理》中文版PDF+英文版PDF+源代碼 - 0 B|- 《Python深度學習》2018中文版pdf+英文版pdf+源代碼 - 0 B|- 《Python編程:從入門到實踐》中文版+源代碼 - 0 B|- stanford machine learning - 0 B|- Python語言程序設計2018版電子教案 - 0 B|- Python網絡編程第三版 (原版+中文版+源代碼) - 0 B|- Python機器學習實踐指南(中文版帶書簽)、原書代碼、數據集 - 0 B|- python官方文檔 - 0 B|- Python編程(第4版 套裝上下冊) - 0 B|- PyQt5快速開發與實戰(pdf+源碼) - 0 B|- linux - 0 B|- 征服PYTHON-語言基礎與典型應用.pdf - 67.40 MB|- 與孩子一起學編程_中文版_詳細書簽.pdf - 69.10 MB|- 用Python做科學計算.pdf - 6.10 MB|- 用Python寫網絡爬蟲.pdf - 9.90 MB|- 用Python進行自然語言處理(中文翻譯NLTK).pdf - 4.40 MB|- 像計算機科學家那樣思考 Python中文版第二版.pdf - 712.00 kB|- 網絡爬蟲-Python和數據分析.pdf - 6.90 MB|- 圖解機器學習.pdf - 59.40 MB|- 凸優化.pdf - 5.70 MB|- 數據挖掘導論.pdf - 2.50 MB|- 數據科學入門.pdf - 13.30 MB|- 數據結構與算法__Python語言描述_裘宗燕編著_北京:機械工業出版社_,_2016.01_P346.pdf - 74.30 MB|- 神經網絡與深度學習.pdf - 92.60 MB|- 深入Python3...
標簽: python
上傳時間: 2022-06-06
上傳用戶:
程序清單A中收錄了產生PPM-TH和PAM-DS這兩個信號源的所有函數;程序清單B中收錄了加性高斯白噪聲(AWGN)信道建模,正交和非正交單脈沖PPM-TH接收機結構,以及反極性PAM-DS單脈沖接收機結構仿真所需的所有函數。
上傳時間: 2013-12-22
上傳用戶:hwl453472107
Program main BIOS image | | /B - Program Boot Block | | /N - Program NVRAM | | /C - Destroy CMOS checksum | | /E - Program Embedded Controller Block | | /K - Program all non-critical blocks | | /Kn - Program n th non-critical block only(n=0-7) | | /Q - Silent execution | | /REBOOT - Reboot after programming | | /X - Don t Check ROM ID | | /S - Display current system s ROMID | | /Ln - Load CMOS defaults
標簽: Program Destroy Block NVRAM
上傳時間: 2016-07-26
上傳用戶:wfl_yy
21世紀大學新型參考教材系列 集成電路B 荒井
上傳時間: 2013-04-15
上傳用戶:eeworm
家電維修(最基礎的教程B)1-20.Torrent
上傳時間: 2013-06-10
上傳用戶:eeworm
jk-b交通信號控制機原理圖
上傳時間: 2013-07-13
上傳用戶:eeworm
專輯類-實用電子技術專輯-385冊-3.609G jk-b交通信號控制機原理圖-1.3M.zip
上傳時間: 2013-08-02
上傳用戶:zhf1234
專輯類-電子基礎類專輯-153冊-2.20G 21世紀大學新型參考教材系列-集成電路B-荒井-159頁-2.8M.pdf
上傳時間: 2013-05-16
上傳用戶:pkkkkp