Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <iostream>
- #include <cmath>
- #include <fstream>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "russian");
- fstream F;
- F.open("kpop.txt",ios::out);
- int a;
- for (int i=0; i<10; i++){
- cin >> a;
- F << " " << a;
- }
- F.close();
- int sum, X;
- sum=0;
- F.open("kpop.txt",ios::in);
- while (!F.eof()){
- F >> X;
- sum=sum+X;
- }
- cout << sum;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement