游客 Signup | Login
中文 | En

3268 - 习题4-8-1 百分制成绩转换为等级

从键盘输入一百分制成绩,要求输出其所对应的等级'A', 'B', 'C', 'D'。85分以上(含)为'A',70~84分之间为'B',60~69分之间为'C',60分以下为'D'。

请用if语句实现。

Input

百分制成绩,保证成绩在0~100之间。

Output

百分制成绩所对应的等级,末尾输出换行。

Examples

Input

73

Output

B

Solution C

#include<stdio.h>
int main()
{
  int a;
  scanf("%d",&a);
  if(a>60)
  {
    if(a<=69)printf("C");
    else if(a<=84)printf("B");
      else printf("A");
  }
  else printf("D");
  printf("\n");
  return 0;
}

Solution C++

#include<iostream>
using namespace std;
int main()
{
	int score;
	cin>>score;
	if (score>=85) cout<<'A'<<endl;
	else if (score>=70 && score<=84) cout<<'B'<<endl;
	else if (score>=60 && score<=69) cout<<'C'<<endl;
	else cout<<'D'<<endl;
	return 0;
}
Time Limit 1 second
Memory Limit 12 MB
Discuss Stats
上一题 下一题