c语言字符串转为大写,c语言 字符串转大写的简单实例

本文提供C语言将字符串转为大写的实例代码,包括将字符串全部转大写、首字母转大写等。示例代码涵盖不同场景,适合初学者参考学习。
摘要由CSDN通过智能技术生成

c语言 字符串转大写的简单实例

复制代码 代码如下:

#include

#include

#include

#include

int main(void)

{

int length, i;

char string[20]= "this is a string";

length = strlen(string);

for (i=0; i

{

string[i] = toupper(string[i]);

}

printf("%s\n",string);

system("pause");

return 0;

}

时间: 2013-12-10

6b5aa0751a6f1e6a9d0b665a02cc1f46.gif

C语言之实现字符串小写变大写的实例 输入字符串单词,将单词小写全部变为大写. #include #include #include using namespace std; int main() { vector ss; string s; while(cin>>s) ss.push_back(s); for(int i=0;i

描述 给定一个字符串,将其中所有的小写字母转换成大写字母. 输入 输入一行,包含一个字符串(长度不超过100,可能包含空格). 输出 输出转换后的字符串. 样例输入 helloworld123Ha 样例输出

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值