Witam. Mógłby ktoś wytłumaczyć mi gdzie robię błąd?
> #include <iostream>
>
> using namespace std;
> int a,b,t;
> int potega(int n,int m);
> int main()
> {
> cin>>t;
> for(int i=0;i<t;i++)
> {
> cin>>a>>b;
> if(b>4){
> b=b%4;}
>
> a=a%10;
> int c=potega(a,b)%10;
> cout<<c<<endl;
> }
>
>
> return 0;
> }
>
>
> int potega(int n,int m)
> {
> if(m==0) return 1;
> else return n*potega(n,m-1);
> }
created
last reply
- 2
replies
- 534
views
- 2
users
- 1
like