Advertisement
Skorpid

Moduly1

Nov 30th, 2015
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. Main.cpp
  2. ----------------------------------
  3. #include <iostream>
  4. #include "mod1.hpp"
  5. using namespace std;
  6. int main()
  7. {
  8.     int a,b;
  9.     cout<<"Podaj a: ";
  10.     cin>>a;
  11.     cout<<"Podaj b: ";
  12.     cin>>b;
  13.     cout<<a<<" + "<<b<<" = "<<suma(a,b);
  14.     return 0;
  15. }
  16. ----------------------------------
  17. mod1.hpp
  18. ----------------------------------
  19. #ifndef MOD1_HPP_INCLUDED
  20. #define MOD1_HPP_INCLUDED
  21.  
  22. int suma(int x, int y);
  23.  
  24. #endif // MOD1_HPP_INCLUDED
  25.  
  26. ----------------------------------
  27. mod1.cpp
  28. ----------------------------------
  29. #include "mod1.hpp"
  30.  
  31. int suma(int x, int y)
  32. {
  33.     return x+y;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement