Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <string>
- using namespace std;
- class Hello
- {
- public:
- int x, n, a;
- int Kalkulimi()
- {
- int S = 0;
- for (int i = 1; i <= n + 1; i++)
- {
- S = S + (2 * i + a);
- }
- return 3 * x + 4 * S;
- }
- };
- int main()
- {
- Hello beta;
- beta.x = 2;
- beta.n = 3;
- beta.a = 4;
- beta.Kalkulimi();
- cout << "Vlera e funksionit eshte : " << beta.Kalkulimi() << endl;
- cin.get();
- cin.get();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement