1 / 9

13 题

13 题. 判断成绩等级,输入某学生成绩,如果 86 分以上 ( 包括 86 分)则输出 “ VERY GOOD ” ,如果在 60 到 85 之间的则输出 “ GOOD ” ( 包括 60 和 85) ,小于 60 的则输出 “ BAD ” 。 Input 输入只有一行,包括 1 个整数。 Output 输出只有一行(这意味着末尾有一个回车符号)。 Sample Input 80 Sample Output GOOD. program rm13; var a:integer; begin readln(a); case a of

Download Presentation

13 题

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 13题 判断成绩等级,输入某学生成绩,如果86分以上(包括86分)则输出“VERY GOOD”,如果在60到85之间的则输出“GOOD”(包括60和85),小于60的则输出“BAD”。 Input 输入只有一行,包括1个整数。 Output 输出只有一行(这意味着末尾有一个回车符号)。 Sample Input 80 Sample Output GOOD program rm13; var a:integer; begin readln(a); case a of 86..100: write('VERY GOOD'); 60..85: write('GOOD'); else write('BAD'); end; end. program rm13; var a:integer; begin readln(a); if a>=86 then write('VERY GOOD'); if (a>=60) and (a<=85) then write('GOOD'); if a<60 then write('BAD'); end.

  2. program rm13; var a:integer; ch:char; begin readln(a); case a of 86..100: ch:='VERY GOOD'; 60..85: ch:='GOOD'; else ch:='BAD'; end; writeln(ch); end. ch:string;

  3. readln(a,b); 3 4 3 4

  4. 题19:判断三个整数是否相邻--判断三个整数是否相邻,是输出"TRUE",否则输出"FALSE"。题19:判断三个整数是否相邻--判断三个整数是否相邻,是输出"TRUE",否则输出"FALSE"。 Input 输入只有一行,包括3个整数。 Output 输出只有一行。 Sample Input 1 2 3 Sample Output TRUE

  5. 4 3 5 4 3 5 program rm19; var a,b,c,t:integer; begin readln(a,b,c); if a<b then begin t:=a;a:=b;b:=t; end; if a<c then begin t:=a;a:=c;c:=t;end; if b<c then begin t:=b;b:=c;c:=t;end; if (a-b<>1) or (b-c<>1) then write('FALSE') else write('TRUE'); End. 5 3 4 5 4 3

  6. 题9:温度转换:编一程序,将摄氏温度换为华氏温度。公式为:f=9/5*c+32。其中f为华氏温度,c是摄氏温度。题9:温度转换:编一程序,将摄氏温度换为华氏温度。公式为:f=9/5*c+32。其中f为华氏温度,c是摄氏温度。 Input 输入一行,只有一个整数c Output 输出只有一行,包括1个实数。(保留两位小数) 题10:判断奇偶数:输入一个整数,判断是否为偶数。是输出"y e s",否则输出"n o"。 Input 输入只有一行,包括1个整数。 Output 输出只有一行。 Sample Input 2 Sample Output y e s 题11:行礼托运价格:某车站行李托运收费标准是:10公斤或10公斤以下,收费2.5元,超过10公斤的行李,按每超过1公斤增加1.5元进行收费。 试编一程序,输入行李的重量,算出托运费。 Input 输入只有一行,包括1个整数。 Output 输出只有一行,包括1个数。 (保留两位小数) Sample Input 10 Sample Output 2.50 题12:两数比大小:有A,B两个不相等的数,请将其中较大数打印出来。 Input 输入只有一行,包括2个整数。之间用一个空格分开。 Output 输出只有一行(这意味着末尾有一个回车符号),包括1个整数。 Sample Input 45 78 Sample Output 78

  7. 题13:判断成绩等级。Description 输入某学生成绩,如果86分以上(包括86分)则输出“VERY GOOD” ,如果在60到85之间的则输出“GOOD”(包括60和85),小于60的则输出“BAD”。 Input 输入只有一行,包括1个整数。 Output 输出只有一行(这意味着末尾有一个回车符号)。 Sample Input 80 Sample Output GOOD 题14:求三个数的最大数已知有三个不等的数,将其中的最大数找出来。 Input 输入只有一行,包括3个整数。之间用一个空格分开。 Output 输出只有一行(这意味着末尾有一个回车符号),包括1个整数。 Sample Input 1 5 8 Sample Output 8 program rm14; v 题15:求三个数的大小顺序:输入三个数,按由大到小顺序打印出来。 Input 输入只有一行,包括3个整数。之间用一个空格分开。 Output 输出只有一行,包括3个整数。之间用一个空格分开。 Sample Input 3 8 2 Sample Output 8 3 2

  8. 题16:判断某年某月的天数--输入年,月,然后告诉该月有多少天。题16:判断某年某月的天数--输入年,月,然后告诉该月有多少天。 Input 输入只有一行,包括2个整数。之间用一个空格分开。 Output 输出只有一行(这意味着末尾有一个回车符号),包括1个整数。 Sample Input 2000 2 Sample Output 29 (符合以下条件之一的年份即为闰年) 1、能被4整除而不能被100整除。(如2100年就不是闰年) 2、能被400整除。 题17:任意输入一个三位整数,再把它的次序打乱重新组合一个新的三位整数,使其值最大。 Input 输入只有一行,包括1个整数。 Output 输出只有一行(这意味着末尾有一个回车符号),包括1个整数。 Sample Input 470 Sample Output 740 思路:把三位拆除出来,求出最大、中间、最小 题18:找出最经济型的包装箱型号--已知有A,B,C,D,E五种包装箱,为了不浪费材料,小于10公斤的用A型,大于等于10公斤小于20公斤的用B型,大于等于20公斤小于40公斤的用C型,大于等于40公斤的小于50公斤的用D型,大于等于50公斤小于80公斤的用E型。现在输入一货物的重量(小于80公斤),找出最经济型的包装箱型号。 Input 输入只有一行,包括一个整数。 Output 输出只有一行(这意味着末尾有一个回车符号),包括1个字符。 Sample Input 8 Sample Output A

  9. 题19:判断三个整数是否相邻--判断三个整数是否相邻,是输出"TRUE",否则输出"FALSE"。题19:判断三个整数是否相邻--判断三个整数是否相邻,是输出"TRUE",否则输出"FALSE"。 Input 输入只有一行,包括3个整数。 Output 输出只有一行。 Sample Input 1 2 3 Sample Output TRUE

More Related