當前位置:首頁 » 編程軟體 » 編程中成績

編程中成績

發布時間: 2022-09-06 22:11:42

『壹』 在c語言編程中,給出一個百分製成績,要求輸出成績等級

#include <stdio.h>

int main()

{

int score, m;

scanf("%d", &score);

while (score < 0 || score > 100){

printf("Error! Retry! ");

scanf("%d", &score);

}

m= score / 10;

if (m>= 9)

printf("Grade is A! ");

switch(m){

case 0: printf("Grade is E! "); break;

case 1: printf("Grade is E! "); break;

case 2:printf("Grade is E! "); break;

case 3:printf("Grade is E! "); break;

case 4:printf("Grade is E! "); break;

case 5: printf("Grade is E! "); break;

case 6: printf("Grade is D! "); break;

case 7: printf("Grade is C! "); break;

case 8: printf("Grade is B! "); break;

}

return 0;

}

(1)編程中成績擴展閱讀

其他實現輸出成績等級『A'、』B『、'C'、『D'、'E』。90分以上為A,80~89分為B,70~79分為C,60~69分為D,60分一下為E的方法:

#include <stdio.h>

int main()

{

int score;

scanf("%d", &score);

while (score < 0 || score >100){

printf("Error! Retry! ");

scanf("%d", &score);

}

if (score < 60)

printf("Grade is E! ");

else if (score >= 60 && score < 70)

printf("Grade is D! ");

else if (score >= 70 && score < 80)

printf("Grade is C! ");

else if (score >=80 && score < 90)

printf("Grade is B! ");

else

printf("Grade is A! ");

return 0;

}

『貳』 VB編程-成績判斷

Private Sub Command1_Click()
Select Case text1.Text
Case Is < 60
label1.Caption = "不及格"
Case Is <= 75
label1.Caption = "及格"
Case Is <= 85
label1.Caption = "良好"
Case Is <= 100
label1.Caption = "優秀"
Case Else
label1.Caption = "輸入成績錯誤"
End Select
End Sub

『叄』 用c語言編程學生成績,分為優秀,良好,及格,不及格四類,用if~else~if結構如何編輯

#include<stdio.h>
int main()
{
int i,b=0,j=0,l=0,y=0,a[10];
printf("請輸入10個學生的成績\n");
for(i=0;i<10;i++)
scanf("%d",&a[i]);
for(i=0;i<10;i++)
{
if(a[i]<60)
{
b++;
}
else if(a[i]<70)
{
j++;
}
else if(a[i]<80)
{
l++;
}
else if(a[i]<=100)
{
y++;
}
}
printf("優秀%d\n",y);
printf("良好%d\n",l);
printf("及格%d\n",j);
printf("不及格%d\n",b);
return 0;
}

『肆』 編程:輸入成績,輸出等級優良中差

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string str = "";
Console.WriteLine("請輸入你的成績");
double markscore = double.Parse(Console.ReadLine () );//數據轉換,string到double
int score =(int) markscore / 10;
switch (score)
{
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
str = "不及格";
break;
case 6:
str = "及格";
break;
case 7:
str = "中等";
break;
case 8:
str = "良好";
break;
case 9:
case 10:
str = "優秀";
break;
default :
str = "輸入錯誤";
break ;
}
Console.WriteLine("你的成績等級是:"+str );
Console.ReadKey();
}
}
}
用c#寫的,其他語言的原理也是一樣的。

『伍』 C語言編程--輸入5個學生成績 判斷是否及格

#include "stdio.h"

int main()

{

int score;

printf("請輸入一個成績:");

scanf("%d",&score);

if(score>60 && score<=100)

printf("成績合格 ");

else if(score<60 && score>=0)

printf("成績不合格 ");

else

printf("輸入的成績有誤 ");

}

例如:

#include<stdio.h>

int main()

{

int a[5];

int i, index = 0;

printf("請輸入五個學生的成績, 用空格隔開: ");

for(i = 0; i < 5; ++i)

{

scanf("%d", &a[i]);

}

index = 0;

for (i = 0; i < 5; ++i)

{

if (a[index] < a[i])

{

index = i;

}

}

printf("最高分:%d ", a[index]);

printf("不及格分數: ");

for(i = 0; i <5; ++i)

{

if (a[i] < 60)

{

printf("%d ", a[i]);

}

}

}

(5)編程中成績擴展閱讀:

C語言包含的各種控制語句僅有9種,關鍵字也只有32 個,程序的編寫要求不嚴格且以小寫字母為主,對許多不必要的部分進行了精簡。實際上,語句構成與硬體有關聯的較少,且C語言本身不提供與硬體相關的輸入輸出、文件管理等功能,如需此類功能,需要通過配合編譯系統所支持的各類庫進行編程,故c語言擁有非常簡潔的編譯系統。

C語言是一種結構化的語言,提供的控制語句具有結構化特徵,如for語句、if⋯else語句和switch語句等。可以用於實現函數的邏輯控制,方便麵向過程的程序設計。

『陸』 C語言編程 關於成績的問題

include"stdio.h"
main( )
{
char a1;
scanf("%c",&a1);
if(a1='a'||a1='A'||a1='b'||a1='A')
prinf("s",「良好」);
else if(a1='c'||a1='C'||a1='d'||a1='D')
printf("s",「及格」);
printf("s",「不及格」);
}
必須說明:我剛申請的這個東西,而且我對C、c++也是初學者。開始沒看到底下有高手答了已經,獻丑了,我可能不對,這是我自己編的第二個程序,初學者,,不要笑我,謝謝!

『柒』 如何用C語言編程出「給出一個百分製成績,要求輸出成績等級」

因為你的score是char類型,char單字元的話,只能讀一個字元。比如你輸入80,其實讀入的是8,所以讀入的數字一定小於10,自然就是E了

不信的話可以看下如下代碼的結果

代碼之路還很長,樓主加油~~

至於怎麼改,改成int輸入即可。

『捌』 編程,輸入學生成績,把成績按ABCDE等級排出來(用函數調用)

#include<conio.h>
#include<stdio.h>
void
main()
{
int
a=0;
printf("請輸入學生成績:(按0退出)\n");
scanf("%d",&a);
while(a!=0)
{
switch(a/10)
{
case
10:
case
9:
printf("A\n");break;
case
8:
printf("B\n");break;
case
7:
printf("C\n");break;
case
6:
printf("D\n");break;
default:
printf("E\n");break;
}
printf("請輸入學生成績:(按0退出)\n");
scanf("%d",&a);
}
}

『玖』 用C語言編程 學生成績統計

#include<stdio.h>
voidprint1(inta[],intn){
for(inti=0;i<n;i++)
printf("%d",a[i]);
printf(" ");
}

intmain()
{
inta[30],i,j,k=0,m=0,b[30],c[30],d[10]={0};
for(i=0;i<30;i++){
intscore;
scanf("%d",&score);
if(score<0){
j=i;
break;
}
a[i]=score;
}
for(i=0;i<j;i++){
if(a[i]>60)
b[k++]=a[i];
else
c[m++]=a[i];
d[a[i]/10]++;
}
printf("及格人數%d ",k);
print1(b,k);
printf("不及格人數%d ",m);
print1(c,m);
for(i=0;i<10;i++){
printf("%d到%d占:%d%% ",i,(i+1)*10-1,d[i]*10);
}
}

熱點內容
unzipforlinux 發布:2025-03-21 08:49:57 瀏覽:952
安卓wlan信號慢怎麼辦 發布:2025-03-21 08:35:35 瀏覽:869
keil無法編譯 發布:2025-03-21 08:25:51 瀏覽:307
怎麼設置蘋果鎖屏密碼忘了怎麼辦啊 發布:2025-03-21 08:20:48 瀏覽:621
報稅自然人密碼是什麼 發布:2025-03-21 08:20:47 瀏覽:480
我的世界開局送一套房的伺服器 發布:2025-03-21 08:16:32 瀏覽:66
網格搜索演算法 發布:2025-03-21 08:16:29 瀏覽:516
君越哪個配置有液晶儀表盤 發布:2025-03-21 08:10:44 瀏覽:873
mysql資料庫名字 發布:2025-03-21 08:10:04 瀏覽:366
安卓如何掃描瀏覽器中的二維碼 發布:2025-03-21 08:04:10 瀏覽:678