小写字母转换为大写字母

#include<stdio.h>

int main()
{
    char ch;

    printf("please input:\n");
    scanf("%c",&ch);

    if(ch>=‘a‘&&ch<=‘z‘)
        ch-=32;

    printf("%c",ch);

    getchar();
    return 0;
}

运行结果如下:

原文地址:https://www.cnblogs.com/pyp2001/p/11695735.html

时间: 2024-08-02 19:24:16

小写字母转换为大写字母的相关文章

汇编-小写字母转换为大写字母

一.实习题目:小写字母转换为大写字母 二.实习目的:  1.掌握分支程序设计方法 2.了解小写字母和大写字母在计算机中的表示方法并显示. 三.代码:   data segment A db 'a'; B db 'z'; C db 00h; bb db 0ah,0dh,'$' string db 0ah,0dh,'The input num is not a case letter','$'; data ends code segment assume DS:data,CS:code star

将小写字母转换为大写字母

var pinyin = (function () { var Pinyin = function (ops) { this.initialize(ops); }, options = { checkPolyphone: false, charcase: 'default' }; Pinyin.fn = Pinyin.prototype = { init: function (ops) { this.options = extend(options, ops); }, initialize: f

字母转为大写字母

自定义Scalar-valued Function函数,把字母转换为大写字母. 字母转为大写字母a-->A;b-->B;c-->C;...z-->Z如果非字母转换为'' SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ============================================= -- Author: Insus.NET -- Blog: https://insus.cnblogs.com -- C

python中将指定的字符串转换为大写字母并每隔2个字符用空格分割后得到一个新字符串的方法

在例子中对指定的字符串: faa5fbb5fcc5fdd5010200000028000001900000000a002d00000000017d7840000003e800005fa55fb55fc55fd5 使用了三种方法将其转换为大写字母并每隔2个字符用空格分割处理后得到一个新字符串,为: FA A5 FB B5 FC C5 FD D5 01 02 00 00 00 28 00 00 01 90 00 00 00 0A 00 2D 00 00 00 00 01 7D 78 40 00 00

C#:小写金额转换为大写

#region 小写金额转换为大写 public static string CurrToChnNum(double Currnum) { string sResult = ""; if (Math.Abs(Currnum) < 1e-20) return "零圆整"; if (Currnum < 1e-20) sResult = "负"; sResult = sResult + StringToChnNum(Math.Abs(Mat

小写金转换为大写

<body><input type="text" id="txt"/><br/><input type="button" id="ss" value="submit"/><br/><input type="text" id="result"/></body><script typ

Oracle 小写金额转换为大写

在开发EBS的合同报表打印的时候需要将小写金额转换为大写. 如下是本人自己写的转换函数. 主要思路:先获取小数点位置,在区分整数与小数点处理,根据位数和数字组合读取金额. 最后再处理特殊显示部分. /******************************************************************* *  FUNCTION get_big_amount 数字金额转换为大写 *  p_amount 输入数据金额 *  返回大写金额,位数 :千亿----厘 ****

校验金额、大小写字母、大写字母、合法uri、email

/* 合法uri*/ export function validURL(url) { const reg = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|

将一个句子中单词的首字母转换为大写

如:      hello my name is zeroinger , nice to meet you! 转换后:      Hello My Name Is Zeroinger , Nice To Meet You! 代码:      #include <iostream> #include <cstdio> #include <cstring> #include <cmath> #include <algorithm> #include