Advertisement
Guest User

Untitled

a guest
Nov 19th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. //Start of first (#1) program
  2.  
  3. #include <fstream>
  4. #include <iostream>
  5.  
  6. int main(int argv, char** argc)
  7. {
  8. int Summ{0}, tmp{0};
  9. std::ifstream In;
  10.  
  11. In.open("liczby.txt");
  12.  
  13. while(!In.eof())
  14. {
  15. In >> tmp;
  16. Summ += tmp;
  17. std::cout << tmp << ' ';
  18. }
  19.  
  20. In.close();
  21.  
  22. //std::cout << Summ; //Output Summs in terminal (I don't know where need output this result)
  23. }
  24.  
  25. //End
  26.  
  27. //Start of second (#2) program
  28.  
  29. #include <fstream>
  30. #include <iostream>
  31.  
  32. int main(int argv, char** argc)
  33. {
  34. int tmp{0};
  35. std::ofstream Out;
  36.  
  37. Out.open("liczby.txt");
  38.  
  39. while(std::cin >> tmp, tmp != 0)
  40. {
  41. Out << tmp << ' ';
  42. }
  43.  
  44. Out.close();
  45. }
  46.  
  47. //End
  48.  
  49. //Start of third (#3) program
  50.  
  51. #include <iostream>
  52.  
  53. int main(int argv, char** argc)
  54. {
  55. int FirstNum, *Pointer = &FirstNum;
  56.  
  57. std::cin >> *Pointer;
  58. }
  59.  
  60. //End
  61.  
  62. //Start of fourth (#4) program
  63.  
  64. #include <iostream>
  65.  
  66. struct TData {
  67. int Day;
  68. int Month;
  69. int Year;
  70. };
  71.  
  72. int main(int argv, char** argc)
  73. {
  74. TData Firt, *Point = &Firt;
  75.  
  76. std::cin >> Point->Day >> Point->Month >> Point->Year;
  77.  
  78. //std::cout << Firt.Day << ' ' << Firt.Month << ' ' << Firt.Year; //For result check (Uncomment first two slash for result check)
  79. }
  80.  
  81. //End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement