求下列C语言题?
选择题第17题选择C
编程题:
#include<stdio.h>
void main(){
char str;
printf("请输入一个字符:");
scanf("%c",&str);
if(((int)str>=65&&(int)str<=90)||((int)str>=97&&(int)str<=122)){
printf("%c是一个字母!\n",str);
}else{
printf("%c不是一个字母!\n",str);
}
}#include<stdio.h>
void main(){
int year;
printf("请输入一个年份:");
scanf("%d",&year);
if((year%4==0&&year%100!=0)||year%400==0){
printf("%d年是一个闰年!\n",year);
}else{
printf("%d年不是一个闰年!\n",year);
}
}#include<stdio.h>
void main(){
int a,b,c;
printf("请输入三角形三条边,并用,隔开:");
scanf("%d,%d,%d",&a,&b,&c);
while(a<=0||b<=0||c<=0){
printf("你输入的三条边不正确!\n\n");
printf("请输入三角形三条边,并用,隔开:");
scanf("%d,%d,%d",&a,&b,&c);
}
if(a<b+c&&b<a+c&&c<a+b){
printf("%d,%d,%d构成一个三角形!\n",a,b,c);
}else{
printf("%d,%d,%d不构成一个三角形!\n",a,b,c);
}
}#include<stdio.h>
void main(){
char str;
printf("请输入一个字符:");
scanf("%c",&str);
if((int)str>=48&&(int)str<=57){
printf("%c是数字字符!\n",str);
}else if((int)str>=65&&(int)str<=90){
printf("%c是大写字母字符!\n",str);
}else if((int)str>=97&&(int)str<=122){
printf("%c是小写字母字符!\n",str);
}else{
printf("%c是其它特殊字符!\n",str);
}
}#include<stdio.h>
void main(){
int month;
char *monthArry[12]={"January","February","March","April","May","June","July","August","September","October","November","December"};
printf("请输入月份(1-12之间):");
scanf("%d",&month);
while(month>13||month<1){
printf("你输入的月份不正确!\n\n");
printf("请输入月份(1-12之间):");
scanf("%d",&month);
}
printf("%d月份对应的月份英文单词是:%s。\n",month,monthArry[month-1]);
}