#include <stdio.h>
#include <string.h>
int main()
{
float score;
int temp;
char grade[5];
printf("please input the score;\n");
scanf_s("%f", &score);
temp = (int)score / 10;
switch (temp)
{
case 10:
case 9: strcpy_s(grade,"一等"); break;
case 8:strcpy_s(grade, "二等"); break;
case 7:strcpy_s(grade, "三等"); break;
case 6:strcpy_s(grade, "四等"); break;
default: strcpy_s(grade, "五等");
}
printf("score=%.1f,grade=%s\n", score, grade);
return 0;
}

运行结果:

c语言输出字符串汉字

 

相关文章:

  • 2022-12-23
  • 2021-11-23
  • 2021-09-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-26
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-13
  • 2022-12-23
  • 2021-12-06
  • 2022-03-05
相关资源
相似解决方案