void main() { char str[5][10]={ "优秀","良好"哪猜,"中等","及格","不及搏顷格" },str1[20],c
printf("请输入成绩等级: ")scanf("%s",str1)c=str1[0]
if ( c>='A' &&c<='E' ) printf("成绩%c: %s\n",c,str[c-'A'])
else printf("无效的成绩等基缓陆级。\n")
}
#include "stdio.h"int main(void){
char a[][7]={"90~100","80~89","70~79","60~69","0~59"},ch
printf("Please enter the class code(Error is quit)...\n")
while(scanf(" %c",&ch)==1)
if(ch|=0x20,ch>='a' && ch<='e')
升埋和 printf("%s\n",a[ch-'a'])
else{
printf("Error, exit!\n")
液枝 break
吵盯 }
return 0
}
#include <stdio.h>#include <stdlib.h>春凯信
void main()
{char str1[30],str2[30]
int n,i,j=0
printf("请输入孙运字符串:\n")
gets(str1)
n=strlen(str1)//调用stlen函数计算str字符串的长度
for(i=n-1i>=0i--)
str2[j++]=str1[i]
str2[j]='\0'
printf("输出结果为:%s\n",str2)
}
希望对你有所帮助。扒轮
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)