Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<fstream>
- #include<string>
- using namespace std;
- int main(){
- ofstream myfile;
- myfile.open ("File.txt");
- cout<<"Enter a string the limit is 80 characters"<<endl;
- string text;
- cin>>text;
- if(text.size()<=80){
- myfile <<text;
- myfile<<"End";
- }
- else{
- for(int i=0;i<80;i++){
- myfile<<text.at(i);
- myfile<<"End";
- }
- }
- myfile.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement