freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

簡易股票投資管理系統(tǒng)說明-文庫吧在線文庫

2025-05-12 05:21上一頁面

下一頁面
  

【正文】 數(shù)』 for(i=1 。 fscanf(fp,%f,amp。 for(i=1 。i++ ) { printf(%d\t,stock[i].code)。 // } else if (index==2) //假如會(huì)員id為2 { pfo_file = fopen(, w)。 //儲(chǔ)存買進(jìn)歷史平均價(jià) fprintf(pfo_file,%.2f\n,my_pfo[i].price_now)。 //關(guān)閉檔案}Ⅹ 【其他】int calculate_pfo(struct PORTFOLIO my_pfo[])程式功能:計(jì)算未實(shí)現(xiàn)損益主要計(jì)算公式:Σ(現(xiàn)價(jià)歷史平均價(jià))*張數(shù)*1000參數(shù):struct PORTFOLIO my_pfo[]傳回值:temp_sum加總後之值程式碼:int calculate_pfo(struct PORTFOLIO my_pfo[]) //計(jì)算未實(shí)現(xiàn)投資損益{ int i。 printf(\n按Enter繼續(xù)...)。 float price。 int mount。 float price_buy。/*******************************定義下列副程式*********************************/void manager_main(struct CLUB clubs[])。int load_trade(struct REPORT trade[],FILE *fp)。void save_club(struct CLUB clubs[])。 //紀(jì)錄交易記錄的次數(shù)main(){ FILE *stock_file。 //輸入選項(xiàng)用_password int user_id。 } fclose(club_file)。 scanf(%c,amp。 if(pwd==8888) //預(yù)設(shè)管理者password = 8888 { manager_main(clubs)。 case 39。 //輸入選項(xiàng)用 int i。 printf(\n)。 fflush(stdin)。 printf(請輸入新增會(huì)員的ID:)。 scanf(%s,amp。 //呼叫副程式:儲(chǔ)存結(jié)果 break。 result=search_club(clubs,id)。q39。 //儲(chǔ)存?zhèn)骰刂? printf(請輸入會(huì)員ID:)。i++) { printf(請輸入會(huì)員密碼:)。 exit(1)。 //投資組合種類初始值=0 profit_real=0。 printf(======================================)。 printf(l. 列出買賣紀(jì)錄資料)。 //清除之前輸入殘留值 scanf(%c, amp。b39。 //記錄賣出行為 break。 printf(\n)。 break。 case 39。 for(i=1 。 //個(gè)股現(xiàn)價(jià) fscanf(fp,%f,amp。 //個(gè)股淨(jìng)值 }}void load_club(struct CLUB clubs[],FILE *fp){ int i。clubs[i].pwd)。my_pfo[i].code)。my_pfo[i].price_now)。 //傳回『投資組合種類個(gè)數(shù)』}int load_trade(struct REPORT trade[],FILE *fp){ int i。 fscanf(fp,%s,amp。 fscanf(fp,%f,amp。 //搜尋不到該代碼,傳回1}int search_club(struct CLUB clubs[],int choice){ int i。i++ ) { if(my_pfo[i].code==choice) { return i。 //temp用 float temp_sum=0。 scanf(%d,amp。 price_buy0) //價(jià)格,張數(shù)是否合理 { /***************在投資組合中記錄買進(jìn)動(dòng)作**********/ rec_pfo=rec_pfo+1。 //記錄買進(jìn)價(jià)格 } my_pfo[rec_pfo].price_avg=price_buy。 } } } else { if(m0 amp。i=my_pfo[result1].mount。 printf(紀(jì)錄順利,請繼續(xù)使用\n)。 //temp用_紀(jì)錄位置 int temp_cal。 scanf(%d,amp。 temp_cal=(price_sellmy_pfo[result].price_avg)*m*1000。 //檢查輸入代碼是否在投資組合中 if (result==1) { printf(無該股票庫存記錄\n)。 printf(請輸入賣出價(jià)格)。 //輸入用_股票代碼 int result。 trade[rec_trade].code=my_pfo[result1].code。 //修改買進(jìn)張數(shù) for(i=temp。 trade[rec_trade].mount_buy=m。 //記錄買進(jìn)張數(shù)my_pfo[rec_pfo].price_now=stock[result2].price。 //搜尋投資組合中是否有該代碼 if(result1==1) { result2=search_stock(stock,code)。 printf(請輸入購買價(jià)格)。 //輸入用_股票代號(hào) int result1,result2。 //搜尋正確,則傳回該輸入代碼之pointer } } return 1。 for(i=1 。 fscanf(fp,%f,amp。 //讀入『交易記錄個(gè)數(shù)』 for(i=1 。my_pfo[i].price_buy[j])。my_pfo[i].mount)。num)。clubs[i].id)。 //EPS stock[i].ratio = stock[i].price/stock[i].EPS。 //個(gè)股代碼 fscanf(fp,%s,amp。 /*************結(jié)束程式**************/ exit(1)。 //列印交易記錄結(jié)果 break。 //列印投資組合結(jié)果 printf(未實(shí)現(xiàn)損益=%d\t,profit_pre)。//計(jì)算未實(shí)現(xiàn)損益 printf(p列印投資組合結(jié)果\tt列印交易記錄結(jié)果\n請選擇)。 case 39。v39。 printf(======================================)。 printf(b. 紀(jì)錄買進(jìn)個(gè)股)。 //先前並無存檔記錄,開一新檔案 rec_trade=0。 //紀(jì)錄未實(shí)現(xiàn)損益 char choice。 return result。 //呼叫副程式:查詢是否在會(huì)員名單中 if(result==1) { printf(錯(cuò)誤的會(huì)員ID\n)。 break。 printf(會(huì)員ID刪除完成\n)。 fflush(stdin)。clubs[i].pwd)。 //在會(huì)員資料中找尋,若有重複輸入 if(result!=1) //回傳直將不會(huì)是1 { printf(會(huì)員ID重複輸入,新增失敗,請重新登入\n)。a39。 printf(\n)。 printf(\n)。 //副程式:查詢功能 break。239。: printf(請輸入管理者passward:)。 printf(\n)。 //離開程式 } fclose(stock_file)。 struct REPORT trade[TRADE_NUM+1]。int calculate_pfo(struct PORTFOLIO my_pfo[])。void view_info(struct STOCKINFO stock[])。void trade_sell(struct STOCKINFO stock[],struct PORTFOLIO my_pfo[],struct REPORT trade[])。 struct CLUB{ int id。 }。 char netvalue[10]。\n39。i++ ) { temp_sum=temp_sum+(my_pfo[i].price_nowmy_pfo[i].price_avg)*my_pfo[i].mount*1000。 //根據(jù)張數(shù),逐一儲(chǔ)存買進(jìn)價(jià)格 } fprintf(pfo_file,\n)。i++ ) { fprintf(pfo_file,%d\t,my_pfo[i].code)。 //假如其餘數(shù)為0,則斷行 } } printf(\n)。 //搜尋不到該代碼,傳回1}Ⅷ 【Print】副程式程式功能說明參數(shù)傳回值view_info()列印個(gè)股詳細(xì)資料struct STOCKINFO stock[]:儲(chǔ)存資料的陣列無print_stock()列印個(gè)股基本資訊struct STOCKINFO stock[]:儲(chǔ)存資料的陣列無print_portfolio( )列印投資組合struct PORTFOLIO my_pfo[]:儲(chǔ)存資料的陣列無print_trade( )列印交易記錄struct REPORT trade[]:儲(chǔ)存資料的陣列無程式碼:在此僅舉print_stock為例,其他程式與其類似void print_stock(struct STOCKINFO stock[]) //列印個(gè)股基本資訊{ int i。 fscanf(fp,%f,amp。 fscanf(fp,%s,amp。struct REPORT trade[]:儲(chǔ)存資料的陣列FILE *fp:儲(chǔ)存資料的檔案交易記錄個(gè)數(shù)程式碼:在此僅舉int load_trade為例,其他程式與其類似int load_trade(struct REPORT trade[],FILE *fp){ int i?!?參數(shù):■ struct STOCKINFO stock[]:儲(chǔ)存資料的陣列。 case 39。 break。 printf(\n)。//副程式:記錄賣出行為 break。b39。 //清除之前輸入殘留值 scanf(%c, amp。 printf(l. 列出買賣紀(jì)錄資料)。 printf(=================================)。 //投資組合種類初始值=0 profit_real=0。 //傳回會(huì)員index } } printf(登入錯(cuò)誤超過3次,請重新登入\n)。 //會(huì)員id輸入錯(cuò)誤 exit(1)。int id,passwd。 //呼叫副程式:查詢是否在會(huì)員名單中,正確傳回該index if(result==1) { printf(會(huì)員ID輸入錯(cuò)誤,請重新執(zhí)行\(zhòng)n)。 case 39。 scanf(%s,amp。 printf(請輸入新增會(huì)員的ID:)。fflush(stdin)。printf(\n)。 default: printf(無效的選項(xiàng)\n)。: user_id=user_exam(clubs)。 fflush(stdin)。 printf(請選擇登入身分 )。 //關(guān)閉讀檔 /*******
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1