标签:编程资料 输入 char s cin namespace using bsp char 学生
小学生c++编程资料
链接:https://pan.baidu.com/s/1FfOirxJ9rrY7rxtHUM4W_A
提取码:uqm9
#include<iostream> using namespace std; int main() { int n; char score; cout<<"请输入分数:"; cin>>n; switch(n/10) //n、10是整型,n/10也是整型 { case 10: case 9: score=‘A‘;break; case 8: case 7: score=‘B‘;break; case 6: score=‘C‘;break; case 5: case 4: case 3: case 2: case 1: case 0: score=‘D‘;break; default: score=‘ ‘;break; //一个空格赋值给score } cout<<score; return 0; }
标签:编程资料 输入 char s cin namespace using bsp char 学生
原文地址:https://www.cnblogs.com/kixiaoyuan/p/12695070.html