輸成績單
『壹』 c語言輸出 成績單
看看我下面編寫的,,對你的幫助可能比較大,,,等我編寫好後,在看看我上面的人編寫的,,那個佔用內存這是大,,如果學生人數很多的,,上面那個人佔用的內存將會一直變大,而且他的函數調用竟然還用了數組形參,函數執行效率比較低,而我編寫的程序,佔用內存小,完全克服了上面那個朋友在佔用內存上的問題,程序如下:
#include "stdio.h"
#define memb_count 4 //學生人數
struct student
{
char name[10];
float sce1;
float sce2;
float sce3;
float avg;
};
struct student reslut_table;
//-------輸入函數----------------------
void Input(struct student *pTable)
{
printf(" 姓名 \t 課程1 \t 課程2 \t 課程3 \t 平均分 \t\n");
scanf(" %10s \t",pTable->name);
scanf(" %f \t",pTable->sce1);
scanf(" %f \t",pTable->sce2);
scanf(" %f \t",pTable->sce3);
printf("\n");
}
//=====================================
//--------平均值函數-------------------
float Average(struct student *pTable, int N)
{
return(((pTable->sce1)+(pTable->sce2)+(pTable->sce3))/N);
}
//=====================================
//--------輸出函數---------------------
void output(struct student *pTable)
{
printf(" 姓名 \t 課程1 \t 課程2 \t 課程3 \t 平均分 \t\n");
printf(" %s \t %f \t %f \t %f \t %f \t\n",
pTable->name,pTable->sce1,pTable->sce2,pTable->sce3,
pTable->avg);
}
//===================================
void main(void)
{
int i;
printf("請輸入數據:\n");
for(i=0;i<memb_count;i++)
{
Input(&reslut_table);
reslut_table.avg=Average(&reslut_table,3);
output(&reslut_table);
}
}
『貳』 【求助】救救孩子吧著急啊 學信網成績單認證 輸入中文成績單保存成功 按照教務處發的英文成績單錄入
用不同的瀏覽器嘗試重新保存;
是否填寫的信息或者格式如大小寫 全半形 空格有不符合要求的存在
上述原因都排除就聯系網站客服或者學校教務處咨詢一下 不要著急
『叄』 c++編程:輸入學生成績單,並進行統計,列印出統計表。
題目:利用條件運算符的嵌套來完成此題:學習成績>=90分的同學用A表示,專60-89分之間的用B表示,
屬60分以下的用C表示。
1.程序分析:(a>b)?a:b這是條件運算符的基本例子。
2.程序源代碼:
#include "stdio.h"
#include "conio.h"
main()
{
int score;
char grade;
printf("please input a score\n");
scanf("%d",&score);
grade=score>=90?'A':(score>=60?'B':'C');
printf("%d belongs to %c",score,grade);
getch();
}
給你個參考!~!~!~
『肆』 C語言輸入M個學生N門課程的成績,要求輸出成績單(包括每個學生的平均分及每門課程的平均分)
這個程序滿足你條件了,我vc6通過調試運行了
#include<stdio.h>
void main()
{
float score[200][50]={0};
void inputscore(float**,int,int);
void printscore(float**,int,int);
int m,n;
printf("please decide M=");
scanf("%d",&m);
printf("please decide N=");
scanf("%d",&n);
inputscore(score,m,n);
printscore(score,m,n);
}
void inputscore(float score[200][50],int m,int n)
{
int i,j;
for(i=1;i<=m;i++)
{
printf("input student no%d's score\n",i);
for(j=1;j<=n;j++)
{
scanf("%f",*(score+i)+j);
flushall();
score[0][j]+=*(*(score+i)+j);
score[i][0]+=*(*(score+i)+j);
}
score[i][0]/=n;
}
for(j=1;j<=n;j++)
score[0][j]/=m;
}
void printscore(float score[200][50],int m,int n)
{
int i,j;
printf("the score chart is:\n");
printf("NO\t");
for(j=1;j<=n;j++)
printf("score%d\t",j);
printf("average\n");
for(i=1;i<=m;i++)
{
printf("%d\t",i);
for(j=1;j<=n;j++)
printf("%g\t",*(*(score+i)+j));
printf("%g\n",*(*(score+i)));
}
printf("average\t");
for(j=1;j<=n;j++)
printf("%g\t",*(*(score)+j));
printf("\n");
}
『伍』 成績排序 描述 給出班裡某門課程的成績單,請你按成績從高到低對成績單排序輸出,如果有
不知你是否需要C的,這里提供一段代碼供參考:
#include "stdafx.h"
#include "stdio.h"//
#include "stdlib.h"//
struct student{
char Name[16];
int Score;
};
void main(void){/*主程序*/
struct student *pstu,**px,*temp;
int nRec,i,j;
printf("請輸入錄入數...\nnRec=");
scanf("%d",&nRec);
pstu=(struct student *)malloc(nRec*sizeof(struct student));
px=(struct student **)malloc(nRec*sizeof(struct student *));
if(!pstu || !px){
printf("內存分配失敗...");
exit(0);
}
printf("請錄入姓名和成績(間隔隔開)...\n");
for(i=0;i<nRec;i++){
printf("記錄%d:",i+1);
scanf("%s%d",&(pstu+i)->Name,&(pstu+i)->Score);
px[i]=pstu+i;
}
for(i=0;i<nRec;i++)
for(j=i+1;j<nRec;j++)
if(px[i]->Score<px[j]->Score){
temp=px[j];
px[j]=px[i];
px[i]=temp;
}
for(i=0;i<nRec;i++)
printf("%s %d\n",px[i]->Name,px[i]->Score);
free(pstu);
free(px);
printf("\n");
}
『陸』 Python3 通過循環輸出成績單
#encoding:utf-8
#Python3.6
classmates=['劉達','王爾','李珊','陳思','張悟']
courses=['高等數學','Python程序設計','宏觀經濟學','管理學原理']
grade1={'劉達':89,'王爾':95,'李珊':67,'陳思':75}
grade2={'劉達':75,'王爾':79,'李珊':79}
grade3={'李珊':87,'陳思':91,'張悟':75}
grade4={'劉達':89,'王爾':86,'張悟':99}
#格式化字元串表示,具體內容可以搜索pythonformate
print("{:<6}{:^10}{:^10}{:^10}{:^10}".format("姓名\科目",courses[0],courses[1],courses[2],courses[3]))
fori,nameinenumerate(classmates):
g1,g2,g3,g4="","","",""
ifnameingrade1:
g1=grade1[name]
ifnameingrade2:
g2=grade2[name]
ifnameingrade3:
g3=grade3[name]
ifnameingrade4:
g4=grade4[name]
print("{:^6}{:^18}{:^10}{:^18}{:^18}".format(name,g1,g2,g3,g4))
下面是我的代碼得到的結果:
『柒』 求C++大神給加一個輸出成績單的功能,就是把成績保存到TXT中的功能,感激不盡!!!
string student_to_string(const student_info&);
student_info string_to_student_info(const string & );
按自己想要的寫相對應的這一組函數,然後文件存取直接網路立馬出答案;
這組轉內換一容般是這樣:選取一個特定字元,比如'#'所有student_info中含的『#』字元的全替換成『#0#『
讓後每個數據帶上前綴』#ID#「,同時帶上後綴『#00#,就好像printf參數里的「%」一樣。
『捌』 用2010Excel中有一個成績單,輸入什麼公式,能得出90~100的人數,80~90的人數,70
假設成績一列是 H列,從3行到1000行
那
=sumproct((h3:h1000>=90)*(h3:h1000<=100))
這是計算90(含)到100(含)間的人數
至於小於60的寫法很多,為了與上面統一好理解,可能 使用
=sumproct(h3:h1000<60)
『玖』 用PHP輸出成績單表格
從MYSQL讀取文件,然後判斷值的大小,然後賦值A,B,C,然後用表格顯示就可以了吧
『拾』 c++編程:輸入學生成績單,並進行統計,列印出統計表
建數據結構,記錄每一個學生的各科成績、總分。
計算各科平均分,一個循環,把每一個學生循環一遍,把總分相加,處以實際考試人數即可。
列印總分排名,整一個排序演算法,把排序關鍵字寫成每一個學生的總分即可。