Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Start of first (#1) program
- #include <fstream>
- #include <iostream>
- int main(int argv, char** argc)
- {
- int Summ{0}, tmp{0};
- std::ifstream In;
- In.open("liczby.txt");
- while(!In.eof())
- {
- In >> tmp;
- Summ += tmp;
- std::cout << tmp << ' ';
- }
- In.close();
- //std::cout << Summ; //Output Summs in terminal (I don't know where need output this result)
- }
- //End
- //Start of second (#2) program
- #include <fstream>
- #include <iostream>
- int main(int argv, char** argc)
- {
- int tmp{0};
- std::ofstream Out;
- Out.open("liczby.txt");
- while(std::cin >> tmp, tmp != 0)
- {
- Out << tmp << ' ';
- }
- Out.close();
- }
- //End
- //Start of third (#3) program
- #include <iostream>
- int main(int argv, char** argc)
- {
- int FirstNum, *Pointer = &FirstNum;
- std::cin >> *Pointer;
- }
- //End
- //Start of fourth (#4) program
- #include <iostream>
- struct TData {
- int Day;
- int Month;
- int Year;
- };
- int main(int argv, char** argc)
- {
- TData Firt, *Point = &Firt;
- std::cin >> Point->Day >> Point->Month >> Point->Year;
- //std::cout << Firt.Day << ' ' << Firt.Month << ' ' << Firt.Year; //For result check (Uncomment first two slash for result check)
- }
- //End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement