代码对齐UVa1593
来源:互联网 发布:图像识别算法 知乎 编辑:程序博客网 时间:2024/05/29 13:17
#include <iostream>#include <vector>#include <string>#include <sstream>using namespace std;int main(){ string line[1800]; int i = 0; string s; vector<string> line2; while(getline(cin,s)){ ++i; line[i] = s; line2.push_back(s); //vector类型添加元素 } cout<<"----------------output------------------------"<<endl; for(int k = 1; k <= i; k++){ string x; string tmp = line[k]; stringstream ss(tmp); //把tmp这个string类转成stringstream类ss while(ss >> x) cout<<x<<" "; cout<<endl; } cout<<"----------------output vector--------------"<<endl; for(int k = 0; k < i; k++){ string x; string tmp = line2.at(k); //取出vector类型指定位置的元素 stringstream ss(tmp); while(ss >> x) cout<<x<<" "; cout<<endl; }return 0;}
0 0
- 代码对齐UVa1593
- Uva1593 代码对齐
- uva1593代码对齐
- 5-1 代码对齐 UVA1593
- Alignment of Code (代码对齐)UVA1593
- 算法竞赛入门经典 第二版 习题5-1 代码对齐 Alignment of Code uva1593
- uva1593
- UVA1593
- UVa1593
- UVa1593
- Uva1593
- UVA1593 不定量不定长度单词,左对齐
- 代码对齐
- 代码对齐
- 代码对齐
- VS2008 (vc2008)对齐代码
- matlab 代码批量对齐
- Source insight代码对齐
- 课程笔记 17:数据结构(清华) 图-遍历
- uva 10344 23 out of 5(递归+全排列)
- Windows中制作傻瓜式安装 Yosemite黑苹果教程。看完你就懂了会了
- 学习笔记:AlexNet&Imagenet学习笔记
- iOS总结控件三(UItextField)
- 代码对齐UVa1593
- JavaScript的语法
- 在 UITabBarController 和 UINavigationController tableView被navigati
- MySql避免重复插入记录方法(ignore,Replace,ON DUPLICATE KEY UPDATE)
- Linux最大打开文件描述符数
- POJ 1915 Knight Moves
- leetcode 064 —— Minimum Path Sum
- php
- scala spark编程常见问题总结