輸入百分制成績,要求輸出成績等級A B C D E。用m

2021-05-02 20:12:20 字數 6289 閱讀 7362

1樓:大野瘦子

#include

int main()

else

}return  0;

}matlab的輸入與輸出

輸出語句就是乙個非常簡單的,disp(『yes, of course』)

這樣的話就能輸出yes, of course

如果想要輸出變數就輸出變數名即可 disp(變數名)

關於輸入:

輸入沒啥好說的,就是input

比如說:input(『please input an integer』)

這樣的話就會輸出一句:please input an integer,然後你就能輸進去乙個數值

同時要說的是,input也是有返回值的,可以返回數或者字串兩種型別,而數是已經預設好了的,而字串是沒有預設的,需要自己去宣告,舉個例子

x = input(『yes ,of course』); 可以返回乙個數

x = input(『please input an string』,』s』); 返回乙個字串

給出matlab中的詳細操作

input('such an instance');

x = input('please input an integer');

x = input('please input an string','s');

disp('中文無敵的');

disp(x);

2樓:匿名使用者

if語句就可以實現:

grade=input('請輸入百分之原始成績:');

disp('五級制成績為:')

if(grade<60)

disp('e');

elseif(grade>=60&&grade<70)disp('d');

elseif(grade>=70&&grade<80)disp('c');

elseif(grade>=80&&grade<90)disp('b');

elseif(grade>=90&&grade<=100)disp('a');

end看執行結果:

3樓:yyyao娛樂

clear;

m=input('請輸入乙個數值:');

m=ceil(m/10);

switch m

case

disp('a');

case 8

disp('b');

case 7

disp('c');

case 6

disp('d');

case

disp('e');

otherwise

disp('輸入有誤!')end

輸入乙個百分制成績,要求輸出成績等級a、b、c、d、e。用matlab來做?

4樓:匿名使用者

這個問題用if語句就可以實現啊

grade=input('請輸入百分之原始成績:');

disp('五級制成績為:')

if(grade<60)

disp('e');

elseif(grade>=60&&grade<70)disp('d');

elseif(grade>=70&&grade<80)disp('c');

elseif(grade>=80&&grade<90)disp('b');

elseif(grade>=90&&grade<=100)disp('a');

end看執行結果:

5樓:匿名使用者

if語句就可以實現:

grade=input('請輸入百分之原始成績:');

disp('五級制成績

為:')

if(grade<60)

disp('e');

elseif(grade>=60&&grade<70)disp('d');

elseif(grade>=70&&grade<80)disp('c');

elseif(grade>=80&&grade<90)disp('b');

elseif(grade>=90&&grade<=100)disp('a');

end看執行結果:

6樓:墓之於人生

if expression

statements

elseif expression

statements

else

statementsend

7樓:大野瘦子

#include

int main()

else

}return  0;

}matlab的輸入與輸出

輸出語句就是乙個非常簡單的,disp(『yes, of course』)

這樣的話就能輸出yes, of course

如果想要輸出變數就輸出變數名即可 disp(變數名)

關於輸入:

輸入沒啥好說的,就是input

比如說:input(『please input an integer』)

這樣的話就會輸出一句:please input an integer,然後你就能輸進去乙個數值

同時要說的是,input也是有返回值的,可以返回數或者字串兩種型別,而數是已經預設好了的,而字串是沒有預設的,需要自己去宣告,舉個例子

x = input(『yes ,of course』); 可以返回乙個數

x = input(『please input an string』,』s』); 返回乙個字串

給出matlab中的詳細操作

input('such an instance');

x = input('please input an integer');

x = input('please input an string','s');

disp('中文無敵的');

disp(x);

matlab輸入乙個百分制成績,要求輸出成績等級,a,b,c,d,e

8樓:我是比丘猴

clear;

m=input('請輸入乙個數值:');

m=ceil(m/10);

switch m

case

disp('a');

case 8

disp('b');

case 7

disp('c');

case 6

disp('d');

case

disp('e');

otherwise

disp('輸入有誤!')

endmatlab的吧..這個樣子就可以了吧?不過還是希望樓主下次自己寫,這種程式還是自己寫過才能學到東西,而且這算是基本的了,樓主加油吧~

9樓:大野瘦子

#include

int main()

else

}return  0;

}matlab的輸入與輸出

輸出語句就是乙個非常簡單的,disp(『yes, of course』)

這樣的話就能輸出yes, of course

如果想要輸出變數就輸出變數名即可 disp(變數名)

關於輸入:

輸入沒啥好說的,就是input

比如說:input(『please input an integer』)

這樣的話就會輸出一句:please input an integer,然後你就能輸進去乙個數值

同時要說的是,input也是有返回值的,可以返回數或者字串兩種型別,而數是已經預設好了的,而字串是沒有預設的,需要自己去宣告,舉個例子

x = input(『yes ,of course』); 可以返回乙個數

x = input(『please input an string』,』s』); 返回乙個字串

給出matlab中的詳細操作

input('such an instance');

x = input('please input an integer');

x = input('please input an string','s');

disp('中文無敵的');

disp(x);

10樓:笑哈哈的小鵬

用flor(負無窮方向取整更好喔)

clear;

a=input('請輸入乙個數值:');

a=floor(a/10);

switch a

case

disp('a');

case 8

disp('b');

case 7

disp('c');

case 6

disp('d');

case

disp('e');

otherwise

disp('輸入有誤!')end

11樓:匿名使用者

這個問題用if語句就可以實現啊

grade=input('請輸入百分之原始成績:');

disp('五級制成績為:')

if(grade<60)

disp('e');

elseif(grade>=60&&grade<70)disp('d');

elseif(grade>=70&&grade<80)disp('c');

elseif(grade>=80&&grade<90)disp('b');

elseif(grade>=90&&grade<=100)disp('a');

end看執行結果:

12樓:墓之於人生

if expression

statements

elseif expression

statements

else

statementsend

13樓:匿名使用者

這個不是應該用floor嗎?『看最佳答案裡用的是ceil

14樓:生深燈火

% if_example2

hundred_score=input(』

please input test_score:』);

if hundred_score>=90

grad_score=『a』;

elseif hundred_score>=80&& hundred_score<90

grad_score=『b』;

elseif hundred_score>=70&& hundred_score<80

grad_score=『c』;

elseif hundred_score>=60&& hundred_score<70

grad_score=『d』;

else

grad_score=『e』;

enddisp([『corresponding grad_score:』,grad_score])

輸入乙個百分制成績,要求輸出成績等級a,b,c,d,e. 90分以上為a,80~89分為b

15樓:ding潛水艇

||#include

int main()

return 0;}

16樓:杜哥是個小天才

#include

main()

}if語句:

#include

#include

int main(int aragc, char *argv)else if (score >= 80)printf("b\n");

else if (score >= 70)printf("c\n");

else if (score >= 60)printf("d\n");

else

printf("e\n");

}else

break;

}return 0;

}拓展資料c語言是一門通用計算機程式語言,應用廣泛。c語言的設計目標是提供一種能以簡易的方式編譯、處理低階儲存器、產生少量的機器碼以及不需要任何執行環境支援便能執行的程式語言。

儘管c語言提供了許多低階處理的功能,但仍然保持著良好跨平台的特性,以乙個標準規格寫出的c語言程式可在許多電腦平台上進行編譯,甚至包含一些嵌入式處理器(微控制器或稱mcu)以及超級電腦等作業平台。

某次抽樣調查結果表明,考生的成績(百分制)近似服從正態分佈,平均成績為72分,96分以上的考生佔考生總

因為f 96 copy 96?72 x bai 1 0.023 0.9770 du2 所以x 12 zhi 成績在60至84分之間的dao概率 f 84 f 60 84?72 12 60?7212 1 1 2 1 1 2 0.8413 1 0.6826 故答案為 0.6826 求解 對某地抽樣調查的...

成績排名前百分之十用英語怎麼說,成績排名在前25 ,用英語怎麼說

成績排名前百分之十 results in the top ten percent the result ranks to the top ten persent.直接說top 10 就可以了,學校的官方成績單上一般也都是這麼寫的 top ten percent results.望採納,謝謝!成績排名...

中考成績考了總分的百分之七十,將來高考上二本有希望嗎

中考成績和高考沒有關係,它只能證明你初中以前的學習狀況,高中還沒專有學呢,怎麼可能屬通過它去判斷高考呢?假設你高中成績會與現在持平,按照正確率百分之七十來算,如果滿分按750分算的話,高考能夠考525分。正常情況下這個分數可以上二本,但是也要根據到時候的整體水平來確定。分數普遍高的話分數線還會向上提...