Why I am not able to solve (Sgu 112.ab-ba) in cpp

Revision en1, by Mixa_01, 2024-06-21 23:32:31

here is my code:

include <bits/stdc++.h>

using namespace std;

int main() { double a,b; double sum=0;

cin >> a>>b;

sum = pow(a,b)-pow(b,a); cout << sum<< endl; return 0; }

why it is showing wrong answer on test 5 no matter whay i do.

question: You are given natural numbers a and b. Find ab-ba.

Input

Input contains numbers a and b (1≤a,b≤100).

Output

Write answer to output.

Sample Input

2 3

Sample Output

-1

Tags acm.sgu.ru

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Mixa_01 2024-06-21 23:32:31 528 help me with the solve (published)