SWAP CASE题解
来源:互联网 发布:k线绘图软件 编辑:程序博客网 时间:2024/05/17 02:20
这一题太简单了,没什么好说的,不值得做第二遍
#include <iostream>#include <fstream>#include <string>using namespace std;string switchCase(string lineBuffer) {int size = lineBuffer.size();for(int i=0; i<size; i++) {if(lineBuffer[i] >= 'A' && lineBuffer[i] <= 'Z') {lineBuffer[i] += 32;}else if(lineBuffer[i] >= 'a' && lineBuffer[i] <= 'z') {lineBuffer[i] -= 32;}}return lineBuffer;}int main (int argc, char* argv[]) {ifstream file;string lineBuffer;file.open(argv[1]);while (!file.eof()) {getline(file, lineBuffer);if (lineBuffer.length() == 0)continue; //ignore all empty lineselse {cout << switchCase(lineBuffer) << endl;}}return 0;}
0 0
- SWAP CASE题解
- 【CodeForces555A】Case of Matryoshkas 题解
- 627. Swap Salary--UPDATE and CASE...WHEN
- LeetCode题解:Swap Nodes in Pairs
- leetcode 题解 || Swap Nodes in Pairs 问题
- LeetCode 题解(178): Swap Nodes in Pairs
- LeetCode题解:Swap Nodes in Pairs
- Leetcode题解 24. Swap Nodes in Pairs
- 【LeetCode24】Swap Nodes in Pairs题解
- 24. Swap Nodes in Pairs 题解
- 24. Swap Nodes in Pairs题解
- leetcode题解-24. Swap Nodes in Pairs
- [LeetCode]Swap Nodes in Pairs题解
- Leetcode题解-24. Swap Nodes in Pairs
- leetcode题解-24. Swap Nodes in Pairs
- Lintcode49 Sort Letters by Case solution 题解
- LeetCode题解——Swap Nodes in Pairs
- LeetCode#670 Maximum Swap题解(C++版)
- mysql存储空间使用观察
- 各种排序算法的实现-8(选择排序的实现)
- HBase 健康检查工具
- ORA-01003: no statement parsed
- SELF DESCRIBING NUMBERS题解
- SWAP CASE题解
- 在flex技术中使用flash导出的swc中的flash元件的方法
- const参数,const返回值与const函数
- 软件项目开发管理过程中值得借助的一些工具
- 墨香游戏服务器架构
- 初学Java多线程:线程简介
- flex组件的生命周期
- DP28 求能变成回文的最小插入字符个数 Minimum insertions to form a palindrome @geeksforgeeks
- HBase提供的工具