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

正文內(nèi)容

編程實(shí)習(xí)報(bào)告09061109-楊宇超(專業(yè)版)

2025-09-14 07:35上一頁面

下一頁面
  

【正文】 }/*end ReadLine*/四、程序調(diào)試(說明調(diào)試過程、問題及其解決方法) 這個(gè)函數(shù)中 我采用scanf這個(gè)函數(shù)來讀取成績(jī),在讀取第五個(gè)成績(jī)的時(shí)候發(fā)現(xiàn)讀完后會(huì)在函數(shù)主菜單里出現(xiàn)一次的錯(cuò)誤 這時(shí)我上網(wǎng)查了資料 發(fā)現(xiàn)應(yīng)該在第五個(gè)輸入成績(jī)的時(shí)候在%s后面再加一個(gè)%c 來吃掉一個(gè)回車鍵 這樣主菜單就不會(huì)出現(xiàn)菜單錯(cuò)誤的情況 ,出現(xiàn)了很多失誤小錯(cuò)誤,不過后來在老師和同學(xué)的幫助下。 i 10。\n,name)。i++){ printf(%s,%d,%d,%d,%d,%d\n,students[i],marks[i][0],marks[i][1],marks[i][2],marks[i][3],marks[i][4])。}}/* function SortClass *//*In this function you sort the strings in the array students alphabetically(lexicographically) using a simple bubble sort and the parison functionfor strings strcmp(). Do not forget that as you are changing the order ofstrings in students, you must be changing the order of rows in the arry marks.Note, that when sorting the array students, and when you want to switchith stringwith the (i+1)ststring, all you have to do is switch the pointers, you do nothave to touch the strings themselves.Note that both students and marks are passed to thisfunction by value, for this function does not need to modify thevalue stored in the pointer student. The same applies to marks.*/void SortClass(char** students,int** marks){ int i,j。 } for(i=j。 fflush(stdout)。if ((marks1 = (int**) realloc((void*)marks1,sizeof(int*)*(i+2))) == NULL) merror(8)。 marks1[1] = NULL。//read here}/*end main*//* function InsertStudent *//*This function prompts the user to enter a new student name.The precise form of the prompt is Enter Student Name to be added to Class List:Then this function reads the name from standard input.But it must be able to read any name of any size!! Thus you haveto allocate memory (using malloc()) to read the input into, and ifit is not big enough, must use realloc() to extend it. You are notallowed to allocate more than 10 bytes in one allocation orextend your segment by more than 10 bytes in one call to realloc().Do not forget to deallocate the memory before exiting the function!Once the function has the name to be entered, it traverses the array studentto find out if the name is already there. If so, the function displaysa warning message student xxx already in the class list and terminates (where xxx is the name of the student). If the name is not in the array, thearray students is extended by one item (using realloc()) and a copyof the string with the name is placed there. Also the array marks isextended by one row (using realloc()) and all five marks in that row are set to 1. Then updated arrays students and marks are passed to SortClass()so they can be sorted alphabetically, as you are required to keep the classlist and the list of marks in alphabetical order.Note that both students and marks are passed to this function by reference,for this function on occasions must be able to modify the value stored in thepointer student (in main()) when putting there the very first student or whenrealloc() possibly moves the array in the memory somewhere else.
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評(píng)公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1