1 条题解

  • 0
    @ 2025-4-12 21:54:22

    C :

    #include<stdio.h>
    int main()
    {
    	int score;
    	while(scanf("%d",&score)!=EOF)
    	{
    		if(score>=90)
    			printf("A\n");
    		else if(score>=80&&score<=89)
    			printf("B\n");
    		else if(score>=70&&score<=79)
    			printf("C\n");
    		else if(score>=60&&score<=69)
    			printf("D\n");
    		else 
    			printf("E\n");
    	}
    	return 0;
    }
    

    C++ :

    #include<stdio.h>
    #include<math.h>
    int main()
    {
    	int x;
    	scanf("%d",&x);
    	if(x>=90)
    		printf("A\n");
    	else if(x>=80&&x<90)
    		printf("B\n");
    	else if(x>=70&&x<80)
    	    printf("C\n");
    	else if(x>=60&&x<70)
    		printf("D\n");
    	else
    		printf("E\n");
    	return 0;
    }
    

    Pascal :

    var n:integer;
    begin
    readln(n);
      if n>=90 then write('A');
      if (n>=80) and (n<=89) then write('B');
      if (n>=70) and (n<=79) then write('C');
      if (n>=60) and (n<=69) then write('D');
      if n<60 then write('E');
    end.
    
    • 1

    C语言程序设计教程(第三版)课后习题5.6

    信息

    ID
    2207
    时间
    1000ms
    内存
    128MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者