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

Правка en1, от 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

Теги acm.sgu.ru

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Mixa_01 2024-06-21 23:32:31 528 help me with the solve (published)