C language - the user inputs the score and judges whether the score is passed or not.

//Determine whether the result is passing, passing output: Congratulations, you passed the exam
//Failed output: Unfortunately, you failed, failed to pass the exam
//Output at the end: Good life every day~~~

//判断成绩是否及格,及格输出:恭喜您,您通过考试了
//未及格输出:很遗憾,您未及格,未能通过考试
//结尾都输出:美好生活每一天~~~
#include<stdio.h>
int main()
{
    
    
	const int pass=60;
	
	int score;
	
	printf("请您输入成绩:");
	scanf("%d",&score);                   // 注意:读取输入时,不要漏了 & 
	
	printf("您的成绩是:%d\n",score);      //为了输出时,美观方便,加\n 换行
	
	if(score< pass)
	{
    
    
		printf("很遗憾,您未及格,未能通过考试\n");  //为了输出时,美观方便,加\n 换行
	}
	else
	{
    
    
		printf("恭喜您,您通过考试了\n"); //为了输出时,美观方便,加\n 换行
	}
	
	printf("美好生活每一天~~~\n"); //为了输出时,美观方便,加\n 换行
	
	return 0;
 } 

Guess you like

Origin blog.csdn.net/m0_57495651/article/details/132251710