#include "string.h"
#include "std
io.h"main(){ char str[20],*p;printf("please input strings:\n");gets(str);
p=str;while(*p!='\0')
{if(*p>='a' && *P <='z')*p= *p - 3...
// 转化为小写
$str = "Mary Had A Little Lamb and She LOVED It So";
$str = strtolower($str);
echo $str; // 打印 mary had a little lamb and she loved it so
// 转化为大写
$str = "Mary Had A Little Lamb and She LOVED It So";
$str = strtoupper($str);
echo $str; // 打印 MARY HAD A LITTLE LAMB AND SHE LOVED IT SO
1、打开VC++环境,调节至使自己舒适的环境。调节字体和字的大小。
2、编辑程序:
#include
void main()
{char a;printf("请输入一个小写字母: ");a=getchar(); a=a-32;printf("转换后的大写字母是:%c\n",a);}
3、进行编译,连接,运行,检验结果:
main()
{char x; scanf("%c",&x); if(x>='a' && x<='z') x-=32; printf("%c\n",x);}