【c语言】给定一个大写字母,要求用小写字母输出

// 给定一个大写字母,要求用小写字母输出

#include <stdio.h>

int main()
{
	char c;
	printf("请输入一个大写字母:");
	scanf("%c",&c);
	c = c + 32;
	printf("该大写字母的小写是:%c\n",c);

	return 0;
}

时间: 2024-07-29 00:57:15

【c语言】给定一个大写字母,要求用小写字母输出的相关文章

c语言:给定一个大写字母,用小写字母输出

给定一个大写字母,用小写字母输出 程序: #include<stdio.h> int main() { char   c1,c2; printf("请输入一个大写字母:"); scanf("%c", &c1); c2=c1+32; printf("c2=%c\nc2=%d\n", c2,c2); return 0; } 结果: 请输入一个大写字母:A c2=a c2=97 请按任意键继续. . .

统计一个字符串中大写字母字符,小写字母字符,数字字符出现的次数,其他字符出现的次数。

/** * A:案例演示 * 需求:统计一个字符串中大写字母字符,小写字母字符,数字字符出现的次数,其他字符出现的次数. * [email protected]#$%^ * 分析:字符串是有字符组成的,而字符的值都是有范围的,通过范围来判断是否包含该字符 * 如果包含就让计数器变量自增 */ public static void main(String[] args) { String s = "[email protected]#$%^"; int big = 0; int smal

c语言代码编程题汇总:将字符串中的大写字母转换成小写字母

将字符串中的大写字母转换成小写字母 程序代码如下: 1 /* 2 2017年3月8日21:21:46 3 功能:将字符串中的大写字母转换成小写字母 4 */ 5 /* 6 #include"stdio.h" 7 8 int main() 9 { 10 int n = 0; 11 12 char a[100]; 13 14 printf("please input a string:"); 15 16 gets(a); 17 18 for(int i = 0 ;a[i

在一个字符串中,统计大写字母个数,小写字母个数,其他字符个数的四种算法

题目描述:编写程序,输出字符串中的大写字母.小写小母和其他的个数.如有一个字符串"Helle, This is A test textfile.123456, tannk you!!",则其大写字母个数:3,小写字母个数:29,其他字符个数:18. 这里提供了四种算法,第一种是我们比较好理解的,也属于硬编码问题,其他三种方法要借助JAVA语言的jdk提供的api. 方法一: <!DOCTYPE html> <html lang="en"> &

tolower(将大写字母转换成小写字母)

/*tolower(将大写字母转换成小写字母) 相关函数 isalpha,toupper 表头文件 #include<stdlib.h> 定义函数 int tolower(int c); 函数说明 若参数c为大写字母则将该对应的小写字母返回. 返回值 返回转换后的小写字母,若不须转换则将参数c值返回. 附加说明 范例*/ /* 将s字符串内的大写字母转换成小写字母*/ #include<ctype.h> main() { char s[]="aBcDeFgH12345;!

HDOJ/HDU 1161 Eddy&#39;s mistakes(大写字母转换成小写字母)

Problem Description Eddy usually writes articles ,but he likes mixing the English letter uses, for example "computer science" is written frequently "coMpUtEr scIeNce" by him, this mistakes lets Eddy's English teacher be extremely disco

把一个string串的所有小写字母转成大写字母的例子来看看看全局函数的使用

今天写了一个小例子,把字符串里面的所有小写字母全部转换成大写字母http://blog.csdn.net/yasaken/article/details/7303903 1 #include "stdafx.h" 2 #include <string> 3 #include <algorithm> 4 #include <iostream> 5 6 using namespace std; 7 8 int _tmain(int argc, _TCHA

8.输入一个大写字母,要求小写字母输出

1 #include <stdio.h> 2 #include <stdlib.h> 3 4 int main() 5 { 6 char a,c1; 7 scanf("%c",&a); 8 c1 = a+32; //大写字母与小写字母的ASCII码相差32,'a'=97,'A'=97-32=65 9 printf("%c\n",c1);//%c按字符型输出 10 printf("%d\n",c1); //%d按十进

位操作,大写字母转成小写字母,小写字母转成大写字母

----------------------------------------------------------------------------------------------------------------------------------------------------------------- #include <stdio.h> void main () { //不懂是谁发现的,大写字母和小写字母在二进制位上只相差一位 //大写字母二进制位的第6位为0 //小写字