若运行以下程序时输入:A<回车>,则程序的运行结果是 。#include int main(){char grade;scanf("%c",&grade);printf("Your score:");switch(grade){case 'A': printf("85~100\n");break;case 'B': printf("70~84\n");break;case 'C': printf("60~69\n");break;case 'D': printf("<60\n");break;default: printf("data error!\n");}return 0;}
查看答案
若运行以下程序时输入:A<回车>,则程序的运行结果是 。#include int main(){char grade;scanf("%c",&grade);printf("Your score:");switch(grade){case 'A': printf("85~100\n");case 'B': printf("70~84\n");case 'C': printf("60~69\n");case 'D': printf("<60\n");default: printf("data error!\n");}return 0;}
若运行以下程序时输入:A<回车>,则程序的运行结果是 。#include int main(){void action1(int,int),action2(int,int);char ch;int a=15,b=23;ch=getchar();switch(ch){case 'a':case 'A': action1(a,b);break;case 'b':case 'B': action2(a,b);break;default: putchar('\a');}return 0;}void action1(int x,int y){printf("x+y=%d\n",x+y);}void action2(int x,int y){printf("x*y=%d\n",x*y);}
若运行以下程序时输入:2012<回车>,则程序的运行结果是 。#include int main(){int year,leap;scanf("%d",&year);if (year%4==0){if(year%100==0){if(year%400==0)leap=1;elseleap=0;}elseleap=1;}elseleap=0;if (leap)printf("%d is ",year);elseprintf("%d is not ",year);printf("a leap year.\n");return 0;}
若运行以下程序时输入:2100<回车>,则程序的运行结果是 。#include int main(){int year,leap;scanf("%d",&year);if (year%4==0){if(year%100==0){if(year%400==0)leap=1;elseleap=0;}elseleap=1;}elseleap=0;if (leap)printf("%d is ",year);elseprintf("%d is not ",year);printf("a leap year.\n");return 0;}