当前位置:网站首页>/*Write a function to open the file for input, read the contents of the file into the vector container of string class 8.9: type, and store each line as an element of the container object*/
/*Write a function to open the file for input, read the contents of the file into the vector container of string class 8.9: type, and store each line as an element of the container object*/
2022-07-04 10:26:00 【qq_ fifty-eight million seven hundred and thirty-six thousand t】
#include<fstream>
void fun()
{
string str; vector<string>strs;
while (cin >> str)
strs.push_back(str);
std::ofstream in;
in.open("test.txt");
for (vector<string>::iterator it = strs.begin(); it != strs.end(); it++)
in << *it<<endl;
}
int main(void)
{
fun();
return 0;
}
边栏推荐
- Servlet基本原理与常见API方法的应用
- 【Day2】 convolutional-neural-networks
- [200 opencv routines] 218 Multi line italic text watermark
- Native div has editing ability
- Static comprehensive experiment ---hcip1
- Basic principle of servlet and application of common API methods
- Introduction to tree and binary tree
- Press the button wizard to learn how to fight monsters - identify the map, run the map, enter the gang and identify NPC
- System. Currenttimemillis() and system Nanotime (), which is faster? Don't use it wrong!
- leetcode842. Split the array into Fibonacci sequences
猜你喜欢

Dynamic memory management

Use the data to tell you where is the most difficult province for the college entrance examination!

入职中国平安三周年的一些总结

Remove linked list elements

Rhcsa12

Devop basic command

Dynamic memory management

The future education examination system cannot answer questions, and there is no response after clicking on the options, and the answers will not be recorded

六月份阶段性大总结之Doris/Clickhouse/Hudi一网打尽

Tables in the thesis of latex learning
随机推荐
Custom type: structure, enumeration, union
Advanced technology management - how to design and follow up the performance of students at different levels
Delayed message center design
有老师知道 继承RichSourceFunction自定义读mysql怎么做增量吗?
Deep learning 500 questions
Dynamic memory management
5g/4g wireless networking scheme for brand chain stores
MongoDB数据日期显示相差8小时 原因和解决方案
Introduction to extensible system architecture
Rhcsa operation
Servlet基本原理与常见API方法的应用
Machine learning -- neural network (IV): BP neural network
Dynamic memory management
Idea SSH channel configuration
Latex arranges single column table pictures in double column format articles
Number of relationship models
Basic principle of servlet and application of common API methods
BGP ---- border gateway routing protocol ----- basic experiment
183 sets of free resume templates to help everyone find a good job
System.currentTimeMillis() 和 System.nanoTime() 哪个更快?别用错了!