Could you please look at my code?

Hİ everyone Im new at this site and dont know much about c++ but I was coding something and need your help.

Heres my code(I amusing codeblocks)
The question is: The government is distributing wheat and while they do it they realise a pattern.The first person that comes has 1 bowl with 1 wheat. The second has 2 bowls with 1 , 1 each. The third has 3 bowls 1, 1, 2 and it goes on like the fibonacci sequence. When distributing is finished the last guy comes over and gets N+3 wheat. The government takes T^M(M over T) (modP) tax wheat for a given M and P. T is the given wheat.
The answer is the taken tax.
I know its long but I would appreciate the help.


#include <iostream>

using namespace std;

int a,b,c,d,e,f;
int fiboSayi( int b);
int fiboToplam(int d);
int fibo2Toplam(int p);
int us(int e,int f);

int main()
{
int N,M,P,T,TussuM,Cikti;
cin >> N;
cin >> M;
cin >> P;
T=fibo2Toplam(N)+N+3;
cout<<T;
cout<<"\n";
TussuM=us(T,M);
cout<<TussuM;
cout<<"\n";
Cikti=TussuM%P;
cout<<Cikti;
cout<<"\n";
return 0;
}

int fiboSayi( int b){
int a,k,Toplam,i;
a=1;
k=b;
Toplam=0;
for(i=0;i<k;i++){
Toplam=Toplam+a;
a=Toplam-a;
}
return Toplam;
}

int fiboToplam(int d){
int Toplam=0,i,b;
b=d;
for(i=1;i<b+1;i++){
Toplam=Toplam+fiboSayi(i);
}
return Toplam;
}

int us(int e,int f){
int carpim=1,k,l,i;
k=e;
l=f;
for(i=0;i<l;i++){
carpim=carpim*k;
}
return carpim;
}

int fibo2Toplam(int p){
int Toplam2,k,i;
Toplam2=0;
k=p;
for(i=1;i<=k;i++){
Toplam2=Toplam2+fiboToplam(k);
}
return Toplam2;
}

The codes
The government is distributing wheat and while they do it they realise a pattern.The first person that comes has 1 bowl with 1 wheat. The second has 2 bowls with 1 , 1 each. The third has 3 bowls 1, 1, 2 and it goes on like the fibonacci sequence.
I don't follow. The government is distributing wheat and the people who come to pick up wheat already have wheat in exponentially increasing quantities?

When distributing is finished the last guy comes over and gets N+3 wheat.
What does this mean?
N+3? Where does that fit into the Fibonacci sequence?
What is N?
He "gets" N+3 wheat? Does that mean that he leaves with N+3 wheat, or that [the amount he leaves with] minus [the amount he arrived with] is N+3?

The government takes T^M(M over T) (modP) tax wheat for a given M and P. T is the given wheat.
What?! There's a tax on food that is being given away?!

The problem statement makes no sense to me. It doesn't say what the inputs are nor what needs to be computed.
Yeah I know the question doesnt make sense.
The inputs are N,M and P.
To your first question no the government distributes in exponentially increasing qualities. I stated it wrong. The wheat amounts are what they get at the end of distribution.
N+3 doesnt fit anywhere you are just supposed to add that to get T.
There are N amount of people that get exponentially increasing amount of wheat, and then someone extra comes and gets N+3 wheat in total.
And I know its stupid but yes there is tax on food given away. I tryed to overlooked the flawed logic in the question. I hope you understand.
Topic archived. No new replies allowed.