Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cmath>
- using namespace std;
- int main()
- {
- int D, a, b, potega, cyfra_jednosci;
- cin >> D;
- if (D >= 1 && D <= 10)
- {
- for (int i = 0; i < 10;i++)
- {
- cin >> a;
- cin >> b;
- if ((a >= 1 && a <= 1000000000) && (b >= 1 && b <= 1000000000))
- {
- potega = pow(a, b);
- cyfra_jednosci = potega % 10;
- }
- else
- {
- exit(0);
- }
- cout << cyfra_jednosci << endl;
- }
- }
- else
- {
- exit(0);
- }
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement