#includestdio.h

成都創(chuàng)新互聯(lián)公司"三網(wǎng)合一"的企業(yè)建站思路。企業(yè)可建設(shè)擁有電腦版、微信版、手機(jī)版的企業(yè)網(wǎng)站。實(shí)現(xiàn)跨屏營銷,產(chǎn)品發(fā)布一步更新,電腦網(wǎng)絡(luò)+移動(dòng)網(wǎng)絡(luò)一網(wǎng)打盡,滿足企業(yè)的營銷需求!成都創(chuàng)新互聯(lián)公司具備承接各種類型的成都做網(wǎng)站、網(wǎng)站建設(shè)項(xiàng)目的能力。經(jīng)過10年的努力的開拓,為不同行業(yè)的企事業(yè)單位提供了優(yōu)質(zhì)的服務(wù),并獲得了客戶的一致好評。
int max(int fenshu[])
{
int max = 0;
for(int i = 0;i 10;i++)
{
? if(fenshu[i] max)
? {
? ? ? max = fenshu[i];
? }
}
return max;
}
int min(int fenshu[])
{
int min = 101;
for(int i = 0;i 10;i++)
{
? if(fenshu[i] min)
? {
? ? ? min = fenshu[i];
? }
}
return min;
}
int main()
{
int fenshu[10];
printf("請輸入十個(gè)整數(shù)(0~100)\n");
for(int i = 0; i 10;i ++)
{
? scanf("%d",fenshu[i]);
}
printf("最高分?jǐn)?shù)是%d,最低分?jǐn)?shù)是%d",max(fenshu),min(fenshu));
}
#includestdlib.h
typedef struct
{
char name[30];
double score[3];
}Table;
void Input( Table *t )
{
if (t!=NULL)
{
printf("Input the student's name:\n");
scanf("%s",t-name);
printf("Input the student's scores, from subject 1 to 3:\n");
scanf("%lf %lf %lf", (t-score[0]), (t-score[1]), (t-score[2]) );
}
}
void Output( Table t[] )
{
double average( double s[]);
int i;
if (t!=NULL)
{
printf("\nName\tS1\tS2\tS3\tAve\n\n");
for(i=0; i4; i++)
{
printf("%s\t%3.1f\t%3.1f\t%3.1f\t%4.2f\n", t[i].name, t[i].score[0],
t[i].score[1], t[i].score[2], average(t[i].score));
}
}
}
double average( double s[] )
{
int i;
double sum=0.0;
for(i=0; i3; i++)
{
sum += s[i];
}
return sum/(double)i;
}
main()
{
Table table[4];
int i;
for(i=0; i4; i++)
{
Input(table+i);
}
printf("-----------\n");
Output(table);
}
想不到這么麻煩。
#include?stdio.h
int?main()
{
float?score[2][2]?=?{0};
for?(int?i?=?0;?i??2;?i++)
{
for?(int?j?=?0;?j??2;?j++)
{
scanf("%f",?score[i][j]);
}
}
printf("----------------------\n");
printf("序號語文??數(shù)學(xué)??總成績\n");
printf("----------------------\n");
for?(int?i?=?0;?i??2;?i++)
{
printf("%-4d%-6.1f%-6.1f%6.1f\n",?i?+?1,?score[i][0],?score[i][1],?score[i][0]?+?score[i][1]);
}
return?0;
}
//測試輸出:
//80.0
//90.5
//90.5
//70.5
//----------------------
//序號語文??數(shù)學(xué)??總成績
//----------------------
//1???80.0??90.5???170.5
//2???90.5??70.5???161.0
分享題目:c語言函數(shù)輸出成績單,c語言輸出成績表
文章位置:http://chinadenli.net/article8/dseedip.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站維護(hù)、ChatGPT、面包屑導(dǎo)航、品牌網(wǎng)站設(shè)計(jì)、軟件開發(fā)、網(wǎng)站策劃
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)