#include<iostream> using namespace std; double Shuma(int a,int b,int c, int d); double Prodhimi(int a,int b,int c, int d); int main () { int n; double PRUSHI; cout<<"jepe vleren e n:"; cin>>n; PRUSHI=Shuma(2,n,1,3)+2*Prodhimi(0,n-1,1,1)+3*Shuma(1,6,1,2)+Prodhimi(4,n+1,1,3); cout<< "Vlera = " << PRUSHI; cout<<endl; system("pause"); return 0; } double Shuma(int a,int b,int c, int d) { int i; double S; S=0; for(i=a;i<=b;i++) { S=S+(c*i+d); } return S; } double Prodhimi(int a,int b,int c, int d) { int i; double P; P=1; for(i=a;i<=b;i++) { P=P*(c*i+d); } return P; } |
|
|
Prodhimi(4,n+1,1,3)
Prodhimi(4,n+1,1,-3)
int PRUSHI(int a, int b, int c, int d, bool mode); //mode determines whether to Σ or Π
|
|
|
|
|
|
|
|