C++入门经典-例3.4-根据成绩划分等级

1:代码如下:

C++入门经典-例3.4-根据成绩划分等级C++入门经典-例3.4-根据成绩划分等级
// 3.4.cpp : 定义控制台应用程序的入口点。
//

#include "stdafx.h"
#include <iostream>
using namespace std;
void main()
{
    cout<<"输入成绩"<<endl;
    int iInput;
    cin >> iInput;
    if(iInput>=90)
    {
        cout << "优秀" <<endl;
    }
    else if(iInput>=80&& iInput<90)
    {
        cout << "良好" <<endl;
    }
    else if(iInput>=70 && iInput <80)
    {
        cout << "一般" <<endl;
    }
    else if(iInput>=60 && iInput <70)
    {
        cout << "及格" <<endl;
    }
    else if(iInput<60&&iInput>=0)
    {
        cout << "考试不及格,请再加把劲" <<endl;
    }
    else
    {
        cout<<"输入有误"<<endl;
    }
}
View Code

运行结果:

C++入门经典-例3.4-根据成绩划分等级

 

posted @ 2017-09-11 19:40 一串字符串 阅读(...) 评论(...) 编辑 收藏

相关文章:

  • 2022-12-23
  • 2021-10-30
  • 2022-01-12
  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
  • 2022-01-11
  • 2021-11-14
猜你喜欢
  • 2022-12-23
  • 2021-08-24
  • 2021-08-21
  • 2021-08-29
  • 2022-12-23
  • 2022-01-08
相关资源
相似解决方案