请设计程序实现功能如下:

[复制链接]
查看11 | 回复2 | 2008-11-25 10:30:04 | 显示全部楼层 |阅读模式
读入一个长度小于63个字符的英文句子,将其中每个单词的最后一个字母改成大写,然后输出此句子(这里的“单词”是指由空格隔开的字符串)。
例如,若输入“I am a student to take the examination.”
则应输出“I aM A studenT tO takE thE examinatioA”.

回复

使用道具 举报

千问 | 2008-11-25 10:30:04 | 显示全部楼层
先用strtok按空格划分单词,再将最后一个变为大写,最后输出假设输入为strSym (VC++实现)char *pChar = new char[strSym.GetLength() + 1] ;sprintf(pChar,"%s",strSym);char* token = "";const char* seps = " ";token = strtok(pChar,seps);CString str,strout;
strout = "";while (token != NULL) {
str = t...
回复

使用道具 举报

千问 | 2008-11-25 10:30:04 | 显示全部楼层
另存为x.html 运行试试 .upcase{text-transform:uppercase;}...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行