導航:首頁 > 數據分析 > student數據成員有哪些

student數據成員有哪些

發布時間:2025-05-21 20:56:07

㈠ 在線等 c++ 定義一個描述學生基本情況的類student,數據成員包括學號、c++成績、英語和數學成績

#include<stdio.h>
struct student
{ char num[10]; //學號
float score[3]; //成績
float avr;
}stu[N];

int main()
{int i,j,maxi;
float sum,max,average;
for(i=0;i<N;i++)
{printf("input scores of student%d:\n",i+1);
printf("NO:");
scanf("%s",stu[i].num);
for(j=0;j<3;j++)
{printf("score %d:",j+1);
printf("%f",&stu[i].sorce[j]);
}
}
average=0;
max=0;
maxi=0;
for(i=0;i<N;i++)
{sum=0;
for(j=0;j<3;j++)
sun+=stu[i].sorce[j];
stu[i].avr=sum/3.0;
average+=stu[i].avr;
if(sum>max)
{max=sum;
maxi=i;
}
}
average/=N;
for(i=0;i<N;i++)
{printf("%5s",stu[i].num);
for(j=0;j<3;j++)
printf("%9.2f",stu[i].score[j]);
printf("%8.2f",stu[i].avr);
}
printf("average=%5.2f\n",average);
prinft("his socres are:%6.2f,%6.2f,%6.2f,average:%5.2f.\n",stu[maxi].score[0],stu[maxi].score[1],stu[maxi].score[2],stu[maxi].avr);
return 0;
}

全手打,希望採納~~~有可能在手打過程中出現單詞錯誤,見諒~~~O(∩_∩)O~再次希望採納~~~

閱讀全文

與student數據成員有哪些相關的資料

熱點內容
三菱plc編程軟體使用教程 瀏覽:419
微信收到雙份文件 瀏覽:393
xl39h官方升級60 瀏覽:595
蘋果6安裝不了程序文件 瀏覽:524
神舞幻想存檔放哪個文件夾 瀏覽:370
htmlcssphpjs 瀏覽:253
蘋果5s內購插件 瀏覽:683
鋼琴譜什麼網站最好 瀏覽:595
ihg房間升級次數 瀏覽:29
ipad斗魚網路請求錯誤 瀏覽:515
類似億巴生活的app還有哪些 瀏覽:517
linux文件狀態標志 瀏覽:861
java讀取子文件 瀏覽:1
怎麼隱藏文件手機 瀏覽:479
編程軟體哪個需要錢 瀏覽:875
如何看自己的ie版本 瀏覽:492
2008r2用戶文件夾路徑 瀏覽:755
winzip文件壓縮成多個小文件 瀏覽:562
勒索病毒文件是哪個 瀏覽:855
群聊機器人代碼 瀏覽:728

友情鏈接