杭电oj 2026(首字母变大写)C语言

cs 复制代码
#include<stdio.h>
#include<ctype.h>

void main()
{
	char s[100]="0";
	int i;
	while (fgets(s,sizeof(s),stdin))
	{
		i = 0;
		while (s[i]!='\0')
		{
			if (i == 0)s[0] = toupper(s[0]);
			else if (s[i - 1] == ' ' && s[i] != ' ')s[i] = toupper(s[i]);
			i++;
		}
		printf("%s", s);
	}
}
相关推荐
Pniubi1 小时前
力扣21合并两个有序链表
算法·leetcode·职场和发展
AIgorithmGEEK1 小时前
std::unordered_map 与 std::unordered_set:接口、算法技巧与权衡 (速查)
c++·算法·哈希表·负载因子·桶·unordered_map·unordered_set
上海潭龙东海科技有限公司3 小时前
智慧堆场动态模型三维实时孪生重构智能管控
大数据·网络·数据库·算法·重构
嵌入式 Linux手记3 小时前
一块内存,三种解释:union 的真实用法
linux·c语言·驱动开发·嵌入式
一拳一个呆瓜3 小时前
【STL】头文件:<cmath>
c++·stl
草莓熊Lotso4 小时前
【C++ 基于微服务的即时通讯系统】ElasticSearch 用户数据管理实现
linux·数据库·c++·elasticsearch·微服务·架构
慧都产品智能化4 小时前
Qt 开发 CAD/CAM 工序表的隐性成本分析
c++·qt·qt5·qt6.3
阿庆_AI研发工程师5 小时前
Stanford CS336 Lecture 10:大语言模型推理与性能优化
算法
用户7341681035485 小时前
基于MindSpore的深度残差收缩网络程序
算法
Pniubi5 小时前
力扣239.滑动窗口最大值(优先队列)
算法·leetcode·职场和发展